home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / DIRECTX.ZIP / DDRAW.PAS next >
Encoding:
Pascal/Delphi Source File  |  1996-01-24  |  84.3 KB  |  2,021 lines

  1. unit ddraw ;
  2.  
  3. interface
  4.  
  5. uses OLE2, Windows ;
  6.  
  7. {*==========================================================================
  8.  *
  9.  *  Copyright (C) 1994-1995 Microsoft Corporation.  All Rights Reserved.
  10.  *
  11.  *  Conversion (version 0.8) to Delphi 2.0 by Blake Stone
  12.  *
  13.  *    email:     bstone@dkw.com
  14.  *    home page: http://www.dkw.com/bstone
  15.  *
  16.  *  File:       ddraw.pas
  17.  *  Content:    DirectDraw include file
  18.  *
  19.  *=========================================================================}
  20.  
  21. { The following are included, untranslated from the C declaration,
  22.   for informational purposes only }
  23.  
  24. (*
  25. #define _FAC    0x876
  26. #define MAKE_DDHRESULT( code )  MAKE_HRESULT( 1, _FAC, code )
  27.  
  28. { GUIDS used by DirectDraw objects }
  29.  
  30. DEFINE_GUID( IID_IDirectDraw,                   0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  31. DEFINE_GUID( IID_IDirectDrawSurface,            0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  32. DEFINE_GUID( IID_IDirectDrawPalette,            0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  33. DEFINE_GUID( IID_IDirectDrawClipper,            0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  34. *)
  35.  
  36. const
  37.   REGSTR_KEY_DDHW_DESCRIPTION     = 'Description' ;
  38.   REGSTR_KEY_DDHW_DRIVERNAME      = 'DriverName' ;
  39.   REGSTR_PATH_DDHW                = 'Hardware\DirectDrawDrivers' ;
  40.  
  41.   DDCREATE_HARDWAREONLY           = $00000001 ;
  42.   DDCREATE_EMULATIONONLY          = $00000002 ;
  43.  
  44.   DD_ROP_SPACE                    = (256 div 32) ;      { space required to store ROP array }
  45.  
  46. {*============================================================================
  47.  *
  48.  * DirectDraw Structures
  49.  *
  50.  * Various structures used to invoke DirectDraw.
  51.  *
  52.  *===========================================================================}
  53.  
  54. type
  55.   IDirectDraw = class ;
  56.   IDirectDrawSurface = class ;
  57.   IDirectDrawPalette = class ;
  58.   IDirectDrawClipper = class ;
  59.  
  60. { DDCOLORKEY }
  61.  
  62.   LPDDCOLORKEY = ^DDCOLORKEY ;
  63.   DDCOLORKEY = record
  64.     dwColorSpaceLowValue: DWORD ;     { low boundary of color space that is to
  65.                                         be treated as Color Key, inclusive }
  66.     dwColorSpaceHighValue: DWORD ;    { high boundary of color space that is
  67.                                         to be treated as Color Key, inclusive }
  68.   end ;
  69.  
  70. { DDPIXELFORMAT }
  71.  
  72.   LPDDPIXELFORMAT = ^DDPIXELFORMAT ;
  73.   DDPIXELFORMAT = record
  74.     dwSize: DWORD ;                 { size of structure }
  75.     dwFlags: DWORD ;                { pixel format flags }
  76.     dwFourCC: DWORD ;               { (FOURCC code) }
  77.     case Integer of
  78.       0: (
  79.         dwRGBBitCount: DWORD ;      { how many bits per pixel (BD_4,8,16,24,32) }
  80.         dwRBitMask: DWORD ;         { mask for red bit }
  81.         dwGBitMask: DWORD ;         { mask for green bits }
  82.         dwBBitMask: DWORD ;         { mask for blue bits }
  83.         dwRGBAlphaBitMask: DWORD ) ; { mask for alpha channel }
  84.       1: (
  85.         dwYUVBitCount: DWORD ;      { how many bits per pixel (BD_4,8,16,24,32) }
  86.         dwYBitMask: DWORD ;         { mask for Y bits }
  87.         dwUBitMask: DWORD ;         { mask for U bits }
  88.         dwVBitMask: DWORD ;         { mask for V bits }
  89.         dwYUVAlphaBitMask: DWORD ) ; { mask for alpha channel }
  90.       2: (
  91.         dwZBufferBitDepth: DWORD ) ; { how many bits for z buffers (BD_8,16,24,32) }
  92.       3: (
  93.         dwAlphaBitDepth: DWORD ) ;  { how many bits for alpha channels (BD_1,2,4,8) }
  94.   end ;
  95.  
  96. { DDSCAPS }
  97.  
  98.   LPDDSCAPS = ^DDSCAPS ;
  99.   DDSCAPS = record
  100.     dwCaps: DWORD ;                         { capabilities of surface wanted }
  101.   end ;
  102.  
  103. { DDSURFACEDESC }
  104.  
  105.   LPDDSURFACEDESC = ^DDSURFACEDESC ;
  106.   DDSURFACEDESC = record
  107.     dwSize: DWORD ;                  { size of the DDSURFACEDESC structure }
  108.     dwFlags: DWORD ;                 { determines what fields are valid }
  109.     dwHeight: DWORD ;                { height of surface to be created }
  110.     dwWidth: DWORD ;                 { width of input surface }
  111.     lPitch: LongInt ;                { distance to start of next line (return value only) }
  112.     dwBackBufferCount: DWORD ;       { number of back buffers requested }
  113.     dwZBufferBitDepth: DWORD ;       { depth of Z buffer requested }
  114.     dwAlphaBitDepth: DWORD ;         { depth of alpha buffer requested }
  115.     dwReserved: DWORD ;              { reserved }
  116.     lpSurface: Pointer ;             { pointer to the associated surface memory }
  117.     ddckCKDestOverlay: DDCOLORKEY ;  { color key for destination overlay use }
  118.     ddckCKDestBlt: DDCOLORKEY ;      { color key for destination blt use }
  119.     ddckCKSrcOverlay: DDCOLORKEY ;   { color key for source overlay use }
  120.     ddckCKSrcBlt: DDCOLORKEY ;       { color key for source blt use }
  121.     ddpfPixelFormat: DDPIXELFORMAT ; { pixel format description of the surface }
  122.     ddsCaps: DDSCAPS ;               { direct draw surface capabilities }
  123.   end ;
  124.  
  125. { DDMODEDESC }
  126.  
  127.   LPDDMODEDESC = ^DDMODEDESC ;
  128.   DDMODEDESC = record
  129.     dwSize: DWORD ;                 { size of structure }
  130.     dwFlags: DWORD ;                { enumeration flags }
  131.     dwMonitorFrequency: DWORD ;     { frequency of monitor in mode }
  132.     ddsdSurfaceDesc: DDSURFACEDESC ; { surface being enumerated }
  133.   end ;
  134.  
  135. { DDBLTFX
  136.   Used to pass override information to the DIRECTDRAWSURFACE callback Blt. }
  137.  
  138.   LPDDBLTFX = ^DDBLTFX ;
  139.   DDBLTFX = record
  140.     dwSize: DWORD ;                         { size of structure }
  141.     dwDDFX: DWORD ;                         { FX operations }
  142.     dwROP: DWORD ;                          { Win32 raster operations }
  143.     dwDDROP: DWORD ;                        { Raster operations new for DirectDraw }
  144.     dwRotationAngle: DWORD ;                { Rotation angle for blt }
  145.     dwZBufferOpCode: DWORD ;                { ZBuffer compares }
  146.     dwZBufferLow: DWORD ;                   { Low limit of Z buffer }
  147.     dwZBufferHigh: DWORD ;                  { High limit of Z buffer }
  148.     dwZBufferBaseDest: DWORD ;              { Destination base value }
  149.     dwZDestConstBitDepth: DWORD ;           { Bit depth used to specify Z constant for destination }
  150.     case Integer of
  151.     0: (
  152.       dwZDestConst: DWORD ;                 { Constant to use as Z buffer for dest }
  153.       dwZSrcConstBitDepth: DWORD ;          { Bit depth used to specify Z constant for source }
  154.       dwZSrcConst: DWORD ;                  { Constant to use as Z buffer for src }
  155.       dwAlphaEdgeBlendBitDepth: DWORD ;     { Bit depth used to specify constant for alpha edge blend }
  156.       dwAlphaEdgeBlend: DWORD ;             { Alpha for edge blending }
  157.       dwReserved: DWORD ;
  158.       dwAlphaDestConstBitDepth: DWORD ;     { Bit depth used to specify alpha constant for destination }
  159.       dwAlphaDestConst: DWORD ;             { Constant to use as Alpha Channel }
  160.       dwAlphaSrcConstBitDepth: DWORD ;      { Bit depth used to specify alpha constant for source }
  161.       dwAlphaSrcConst: DWORD ;              { Constant to use as Alpha Channel }
  162.       dwFillColor: DWORD ;                  { color in RGB or Palettized }
  163.       ddckDestColorkey: DDCOLORKEY ;        { DestColorkey override }
  164.       ddckSrcColorkey: DDCOLORKEY ) ;       { SrcColorkey override }
  165.     1: (
  166.       lpDDSZBufferDest: IDirectDrawSurface ; { Surface to use as Z buffer for dest }
  167.       VariantFiller1: DWORD ;
  168.       lpDDSZBufferSrc: IDirectDrawSurface ; { Surface to use as Z buffer for src }
  169.       VariantFiller2: DWORD ;
  170.       VariantFiller3: DWORD ;
  171.       VariantFiller4: DWORD ;
  172.       VariantFiller5: DWORD ;
  173.       lpDDSAlphaDest: IDirectDrawSurface ;  { Surface to use as Alpha Channel }
  174.       VariantFiller6: DWORD ;
  175.       lpDDSAlphaSrc: IDirectDrawSurface ;   { Surface to use as Alpha Channel }
  176.       lpDDSPattern: IDirectDrawSurface ) ;  { Surface to use as pattern }
  177.   end ;
  178.  
  179. { DDCAPS }
  180.  
  181.   LPDDCAPS = ^DDCAPS ;
  182.   DDCAPS = record
  183.     dwSize: DWORD ;                 { size of the DDDRIVERCAPS structure }
  184.     dwCaps: DWORD ;                 { driver specific capabilities }
  185.     dwCaps2: DWORD ;                { more driver specific capabilites }
  186.     dwCKeyCaps: DWORD ;             { color key capabilities of the surface }
  187.     dwFXCaps: DWORD ;               { driver specific stretching and effects capabilites }
  188.     dwFXAlphaCaps: DWORD ;          { alpha driver specific capabilities }
  189.     dwPalCaps: DWORD ;              { palette capabilities }
  190.     dwSVCaps: DWORD ;               { stereo vision capabilities }
  191.     dwAlphaBltConstBitDepths: DWORD ;       { DDBD_2,4,8 }
  192.     dwAlphaBltPixelBitDepths: DWORD ;       { DDBD_1,2,4,8 }
  193.     dwAlphaBltSurfaceBitDepths: DWORD ;     { DDBD_1,2,4,8 }
  194.     dwAlphaOverlayConstBitDepths: DWORD ;   { DDBD_2,4,8 }
  195.     dwAlphaOverlayPixelBitDepths: DWORD ;   { DDBD_1,2,4,8 }
  196.     dwAlphaOverlaySurfaceBitDepths: DWORD ; { DDBD_1,2,4,8 }
  197.     dwZBufferBitDepths: DWORD ;             { DDBD_8,16,24,32 }
  198.     dwVidMemTotal: DWORD ;          { total amount of video memory }
  199.     dwVidMemFree: DWORD ;           { amount of free video memory }
  200.     dwMaxVisibleOverlays: DWORD ;   { maximum number of visible overlays }
  201.     dwCurrVisibleOverlays: DWORD ;  { current number of visible overlays }
  202.     dwNumFourCCCodes: DWORD ;       { number of four cc codes }
  203.     dwAlignBoundarySrc: DWORD ;     { source rectangle alignment }
  204.     dwAlignSizeSrc: DWORD ;         { source rectangle byte size }
  205.     dwAlignBoundaryDest: DWORD ;    { dest rectangle alignment }
  206.     dwAlignSizeDest: DWORD ;        { dest rectangle byte size }
  207.     dwAlignStrideAlign: DWORD ;     { stride alignment }
  208.     dwRops: Array [ 0..DD_ROP_SPACE-1 ] of DWORD ;   { ROPS supported }
  209.     ddsCaps: DDSCAPS ;              { DDSCAPS structure has all the general capabilities }
  210.     dwMinOverlayStretch: DWORD ;    { minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 }
  211.     dwMaxOverlayStretch: DWORD ;    { maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 }
  212.     dwMinLiveVideoStretch: DWORD ;  { minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 }
  213.     dwMaxLiveVideoStretch: DWORD ;  { maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 }
  214.     dwMinHwCodecStretch: DWORD ;    { minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 }
  215.     dwMaxHwCodecStretch: DWORD ;    { maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 }
  216.     dwReserved1: DWORD ;            { reserved }
  217.     dwReserved2: DWORD ;            { reserved }
  218.     dwReserved3: DWORD ;            { reserved }
  219.   end ;
  220.  
  221. { DDOVERLAYFX }
  222.  
  223.   LPDDOVERLAYFX = ^DDOVERLAYFX ;
  224.   DDOVERLAYFX = record
  225.     dwSize: DWORD ;                    { size of structure }
  226.     dwAlphaEdgeBlendBitDepth: DWORD ;  { Bit depth used to specify constant for alpha edge blend }
  227.     dwAlphaEdgeBlend: DWORD ;          { Constant to use as alpha for edge blend }
  228.     dwReserved: DWORD ;
  229.     dwAlphaDestConstBitDepth: DWORD ;  { Bit depth used to specify alpha constant for destination }
  230.     case Integer of
  231.     0: (
  232.       dwAlphaDestConst: DWORD ;        { Constant to use as alpha channel for dest }
  233.       dwAlphaSrcConstBitDepth: DWORD ; { Bit depth used to specify alpha constant for source }
  234.       dwAlphaSrcConst: DWORD ;         { Constant to use as alpha channel for src }
  235.       dckDestColorkey: DDCOLORKEY ;    { DestColorkey override }
  236.       dckSrcColorkey: DDCOLORKEY ;     { DestColorkey override }
  237.       dwDDFX: DWORD ;                  { Overlay FX }
  238.       dwFlags: DWORD ) ;               { flags }
  239.     1: (
  240.       lpDDSAlphaDest: IDirectDrawSurface ; { Surface to use as alpha channel for dest }
  241.       VariantFiller1: DWORD ;
  242.       lpDDSAlphaSrc: IDirectDrawSurface ) ; { Surface to use as alpha channel for src }
  243.   end ;
  244.  
  245. { DDBLTBATCH: BltBatch entry structure }
  246.  
  247.   LPDDBLTBATCH = ^DDBLTBATCH ;
  248.   DDBLTBATCH = record
  249.     lprDest: ^TRect ;
  250.     lpDDSSrc: IDirectDrawSurface ;
  251.     lprSrc: ^TRect ;
  252.     dwFlags: DWORD ;
  253.     lpDDBltFx: LPDDBLTFX ;
  254.   end ;
  255.  
  256. { Callbacks }
  257.  
  258.   LPCLIPPERCALLBACK = function ( lpDDClipper: IDirectDrawClipper; hWnd: HWND;
  259.       code: DWORD; lpContext: Pointer ): DWORD ;
  260.   LPSURFACESTREAMINGCALLBACK = function ( code: DWORD ): DWORD ;
  261.   LPDDENUMMODESCALLBACK = function ( const lpDDModeDesc: DDMODEDESC;
  262.       lpContext: Pointer ): HRESULT ;
  263.   LPDDENUMSURFACESCALLBACK = function ( lpDDSurface: IDirectDrawSurface;
  264.           lpDDSurfaceDesc: LPDDSURFACEDESC; lpContext: Pointer ): HRESULT ;
  265.  
  266. {
  267.   INTERACES FOLLOW:
  268.       IDirectDraw
  269.       IDirectDrawClipper
  270.       IDirectDrawPalette
  271.       IDirectDrawSurface
  272. }
  273.  
  274. { IDirectDraw }
  275.  
  276.   IDirectDraw = class ( IUnknown )
  277.     function Compact: HRESULT ; virtual ; stdcall ; abstract ;
  278.     function CreateClipper ( dwFlags: DWORD ;
  279.         var lplpDDClipper: IDirectDrawClipper ; pUnkOuter: IUnknown ): HRESULT ;
  280.         virtual ; stdcall ; abstract ;
  281.     { CreatePalette's lpColorTable is an ARRAY of TPaletteEntries }
  282.     function CreatePalette ( dwFlags: DWORD ; lpColorTable: PPaletteEntry ;
  283.         var lplpDDPalette: IDirectDrawPalette ; pUnkOuter: IUnknown ): HRESULT ;
  284.         virtual ; stdcall ; abstract ;
  285.     function CreateSurface ( const lpDDSurfaceDesc: DDSURFACEDESC ;
  286.         var lplpDDSurface: IDirectDrawSurface ; pUnkOuter: IUnknown ): HRESULT ;
  287.         virtual ; stdcall ; abstract ;
  288.     function DuplicateSurface ( lpDDSurface: IDirectDrawSurface ;
  289.         var lplpDupDDSurface: IDirectDrawSurface ): HRESULT ;
  290.         virtual ; stdcall ; abstract ;
  291.     {Test Me!} function EnumDisplayModes ( dwFlags: DWORD ;
  292.         const lpDDSurfaceDesc: DDSURFACEDESC ; lpContext: Pointer ;
  293.         lpEnumCallback: LPDDENUMMODESCALLBACK ): HRESULT ;
  294.         virtual ; stdcall ; abstract ;
  295.     {Test Me!} function EnumSurfaces ( dwFlags: DWORD ; const lpDDSD: DDSURFACEDESC ;
  296.         lpContext: Pointer ; lpEnumCallback: LPDDENUMSURFACESCALLBACK ): HRESULT ;
  297.         virtual ; stdcall ; abstract ;
  298.     function FlipToGDISurface: HRESULT ; virtual ; stdcall ; abstract ;
  299.     function GetCaps ( var lpDDDriverCaps: DDCAPS ;
  300.         var lpDDHELCaps: DDCAPS ): HRESULT ; virtual ; stdcall ; abstract ;
  301.     function GetDisplayMode ( var lpDDSurfaceDesc: DDSURFACEDESC ): HRESULT ;
  302.         virtual ; stdcall ; abstract ;
  303.     { GetFourCCCodes' lpCodes is an ARRAY of DWORDs }
  304.     function GetFourCCCodes ( {const!} var lpNumCodes: DWORD ;
  305.         var lpCodes: DWORD ): HRESULT ; virtual ; stdcall ; abstract ;
  306.     function GetGDISurface ( var lplpGDIDDSSurface: IDirectDrawSurface ): HRESULT ;
  307.         virtual ; stdcall ; abstract ;
  308.     function GetMonitorFrequency ( var lpdwFrequency: DWORD ): HRESULT ;
  309.         virtual ; stdcall ; abstract ;
  310.     function GetScanLine ( var lpdwScanLine: DWORD ): HRESULT ;
  311.         virtual ; stdcall ; abstract ;
  312.     function GetVerticalBlankStatus ( var lpbIsInVB: BOOL ): HRESULT ;
  313.         virtual ; stdcall ; abstract ;
  314.     function Initialize ( lpGUID: PGUID ): HRESULT ; virtual ; stdcall ; abstract ;
  315.     function RestoreDisplayMode: HRESULT ; virtual ; stdcall ; abstract ;
  316.     function SetCooperativeLevel ( hWnd: HWND ; dwFlags: DWORD ): HRESULT ;
  317.         virtual ; stdcall ; abstract ;
  318.     function SetDisplayMode ( dwWidth: DWORD ; dwHeight: DWORD ;
  319.         dwBpp: DWORD ): HRESULT ; virtual ; stdcall ; abstract ;
  320.     function WaitForVerticalBlank ( dwFlags: DWORD ; hEvent: THandle ): HRESULT ;
  321.         virtual ; stdcall ; abstract ;
  322.     {CHECKED TO HERE}
  323.   end ;
  324.  
  325. { IDirectDrawPalette }
  326.  
  327.   IDirectDrawPalette = class ( IUnknown )
  328.     function GetCaps ( var lpdwCaps: DWORD ): HRESULT ; virtual ; stdcall ; abstract ;
  329.     function GetEntries ( dwFlags: DWORD; dwBase: DWORD;
  330.         dwNumEntries: DWORD ; const lpEntries: TPaletteEntry ): HRESULT ;
  331.         virtual ; stdcall ; abstract ;
  332.     function Initialize ( lpDD: IDirectDraw; dwFlags: DWORD;
  333.         const lpDDColorTable: TPaletteEntry ): HRESULT ; virtual ; stdcall ; abstract ;
  334.     function SetEntries ( dwFlags: DWORD; dwStartingEntry: DWORD; dwCount: DWORD;
  335.         const lpEntries: TPaletteEntry ): HRESULT ; virtual ; stdcall ; abstract ;
  336.   end ;
  337.  
  338. { IDirectDrawClipper }
  339.  
  340.   IDirectDrawClipper = class ( IUnknown )
  341.     function GetClipList ( var lpRect: TRect; lpClipList: PRgnData;
  342.         var lpdwSize: DWORD ): HRESULT ; virtual ; stdcall ; abstract ;
  343.     function GetHWnd ( var lphWnd: HWND ): HRESULT ; virtual ; stdcall ; abstract ;
  344.     function Initialize ( lpDD: IDirectDraw; dwFlags: DWORD ): HRESULT ;
  345.         virtual ; stdcall ; abstract ;
  346.     function IsClipListChanged ( var lpbChanged: BOOL ): HRESULT ;
  347.         virtual ; stdcall ; abstract ;
  348.     function SetClipList ( lpClipList: PRgnData; dwFlags: DWORD ): HRESULT ;
  349.         virtual ; stdcall ; abstract ;
  350.     function SetHWnd ( dwFlags: DWORD; hWnd: HWND ): HRESULT ;
  351.         virtual ; stdcall ; abstract ;
  352.   end ;
  353.  
  354. { IDirectDrawSurface and related interfaces }
  355.  
  356.   IDirectDrawSurface = class ( IUnknown )
  357.     function AddAttachedSurface ( lpDDSAttachedSurface: IDirectDrawSurface ): HRESULT ;
  358.         virtual ; stdcall ; abstract ;
  359.     function AddOverlayDirtyRect ( const lpRect: TRect ): HRESULT ;
  360.         virtual ; stdcall ; abstract ;
  361.     function Blt ( const lpDestRect: TRect; lpDDSrcSurface: IDirectDrawSurface;
  362.         const lpSrcRect: TRect; dwFlags: DWORD; const lpDDBltFx: DDBLTFX ): HRESULT ;
  363.         virtual ; stdcall ; abstract ;
  364.     function BltBatch ( const lpDDBltBatch: DDBLTBATCH; dwCount: DWORD;
  365.         dwFlags: DWORD ): HRESULT ; virtual ; stdcall ; abstract ;
  366.     function BltFast ( dwX, dwY: DWORD; lpDDSrcSurface: IDirectDrawSurface;
  367.         const lpSrcRect: TRect; dwTrans: DWORD ): HRESULT ;
  368.         virtual ; stdcall ; abstract ;
  369.     function DeleteAttachedSurface ( dwFlags: DWORD;
  370.         lpDDSAttachedSurface: IDirectDrawSurface ): HRESULT ;
  371.         virtual ; stdcall ; abstract ;
  372.     function EnumAttachedSurfaces ( lpContext: Pointer;
  373.         lpEnumSurfacesCallback: LPDDENUMSURFACESCALLBACK ): HRESULT ;
  374.         virtual ; stdcall ; abstract ;
  375.     function EnumOverlayZOrders ( dwFlags: DWORD; lpContext: Pointer;
  376.         lpfnCallback: LPDDENUMSURFACESCALLBACK ): HRESULT ;
  377.         virtual ; stdcall ; abstract ;
  378.     function Flip ( lpDDSurfaceTargetOverride: IDirectDrawSurface;
  379.         dwFlags: DWORD ): HRESULT ; virtual ; stdcall ; abstract ;
  380.     function GetAttachedSurface ( {const} var lpDDSCaps: DDSCAPS;
  381.         var lplpDDAttachedSurface: IDirectDrawSurface ): HRESULT ;
  382.         virtual ; stdcall ; abstract ;
  383.     function GetBltStatus ( dwFlags: DWORD ): HRESULT ;
  384.         virtual ; stdcall ; abstract ;
  385.     function GetCaps ( {const} var lpDDSCaps: DDSCAPS ): HRESULT ;
  386.         virtual ; stdcall ; abstract ;
  387.     function GetClipper ( var lplpDDClipper: IDirectDrawClipper ): HRESULT ;
  388.         virtual ; stdcall ; abstract ;
  389.     function GetColorKey ( dwFlags: DWORD; const lpDDColorKey: DDCOLORKEY ): HRESULT ;
  390.         virtual ; stdcall ; abstract ;
  391.     function GetDC ( var lphDC: HDC ): HRESULT ; virtual ; stdcall ; abstract ;
  392.     function GetFlipStatus ( dwFlags: DWORD ): HRESULT ;
  393.         virtual ; stdcall ; abstract ;
  394.     function GetOverlayPosition ( var lplX, lplY: LongInt ): HRESULT ;
  395.         virtual ; stdcall ; abstract ;
  396.     function GetPalette ( var lplpDDPalette: IDirectDrawPalette ): HRESULT ;
  397.         virtual ; stdcall ; abstract ;
  398.     function GetPixelFormat ( const lpDDPixelFormat: DDPIXELFORMAT ): HRESULT ;
  399.         virtual ; stdcall ; abstract ;
  400.     function GetSurfaceDesc ( const lpDDSurfaceDesc: DDSURFACEDESC ): HRESULT ;
  401.         virtual ; stdcall ; abstract ;
  402.     function Initialize ( lpDD: IDirectDraw;
  403.         const lpDDSurfaceDesc: DDSURFACEDESC ): HRESULT ; virtual ; stdcall ; abstract ;
  404.     function IsLost: HRESULT ; virtual ; stdcall ; abstract ;
  405.     function Lock ( const lpDestRect: TRect; const lpDDSurfaceDesc: DDSURFACEDESC;
  406.         dwFlags: DWORD; hEvent: THandle ): HRESULT ; virtual ; stdcall ; abstract ;
  407.     function ReleaseDC ( hDC: HDC ): HRESULT ; virtual ; stdcall ; abstract ;
  408.     function Restore: HRESULT ; virtual ; stdcall ; abstract ;
  409.     function SetClipper ( lpDDClipper: IDirectDrawClipper ): HRESULT ;
  410.         virtual ; stdcall ; abstract ;
  411.     function SetColorKey ( dwFlags: DWORD; const lpDDColorKey: DDCOLORKEY ): HRESULT ;
  412.         virtual ; stdcall ; abstract ;
  413.     function SetOverlayPosition ( lX, lY: LongInt ): HRESULT ;
  414.         virtual ; stdcall ; abstract ;
  415.     function SetPalette ( lpDDPalette: IDirectDrawPalette ): HRESULT ;
  416.         virtual ; stdcall ; abstract ;
  417.     function Unlock ( lpSurfaceData: Pointer ): HRESULT ;
  418.         virtual ; stdcall ; abstract ;
  419.     function UpdateOverlay ( const lpSrcRect: TRect;
  420.         lpDDDestSurfaceL: IDirectDrawSurface; const lpDestRect: TRect;
  421.         dwFlags: DWORD; const lpDDOverlayFx: DDOVERLAYFX ): HRESULT ;
  422.         virtual ; stdcall ; abstract ;
  423.     function UpdateOverlayDisplay ( dwFlags: DWORD ): HRESULT ;
  424.         virtual ; stdcall ; abstract ;
  425.     function UpdateOverlayZOrder ( dwFlags: DWORD;
  426.         lpDDSReference: IDirectDrawSurface ): HRESULT ;
  427.         virtual ; stdcall ; abstract ;
  428.   end ;
  429.  
  430. const
  431.  
  432. { ddsCaps field is valid. }
  433.   DDSD_CAPS               = $00000000 ;    { default }
  434.  
  435. { dwHeight field is valid. }
  436.   DDSD_HEIGHT             = $00000002 ;
  437.  
  438. { dwWidth field is valid. }
  439.   DDSD_WIDTH              = $00000004 ;
  440.  
  441. { lPitch is valid. }
  442.   DDSD_PITCH              = $00000008 ;
  443.  
  444. { dwBackBufferCount is valid. }
  445.   DDSD_BACKBUFFERCOUNT    = $00000020 ;
  446.  
  447. { dwZBufferBitDepth is valid. }
  448.   DDSD_ZBUFFERBITDEPTH    = $00000040 ;
  449.  
  450. { dwAlphaBitDepth is valid. }
  451.   DDSD_ALPHABITDEPTH      = $00000080 ;
  452.  
  453. { lpSurface is valid. }
  454.   DDSD_LPSURFACE          = $00000800 ;
  455.  
  456. { ddpfPixelFormat is valid. }
  457.   DDSD_PIXELFORMAT        = $00001000 ;
  458.  
  459. { ddckCKDestOverlay is valid. }
  460.   DDSD_CKDESTOVERLAY      = $00002000 ;
  461.  
  462. { ddckCKDestBlt is valid. }
  463.   DDSD_CKDESTBLT          = $00004000 ;
  464.  
  465. { ddckCKSrcOverlay is valid. }
  466.   DDSD_CKSRCOVERLAY       = $00008000 ;
  467.  
  468. { ddckCKSrcBlt is valid. }
  469.   DDSD_CKSRCBLT           = $00010000 ;
  470.  
  471. { All input fields are valid. }
  472.   DDSD_ALL                = $0001f9ee ;
  473.  
  474. {*============================================================================
  475.  *
  476.  * Direct Draw Capability Flags
  477.  *
  478.  * These flags are used to describe the capabilities of a given Surface.
  479.  * All flags are bit flags.
  480.  *
  481.  *==========================================================================*}
  482.  
  483. {****************************************************************************
  484.  *
  485.  * DIRECTDRAWSURFACE CAPABILITY FLAGS
  486.  *
  487.  ****************************************************************************}
  488.  
  489. { Indicates that this surface is a front buffer, back buffer, or
  490.   texture map that is being used in conjunction with a 3DDDI or
  491.   Direct3D HAL. }
  492.  
  493.   DDSCAPS_3D                              = $00000001 ;
  494.  
  495. { Indicates that this surface contains alpha information.  The pixel
  496.   format must be interrogated to determine whether this surface
  497.   contains only alpha information or alpha information interlaced
  498.   with pixel color data (e.g. RGBA or YUVA). }
  499.   DDSCAPS_ALPHA                           = $00000002 ;
  500.  
  501. { Indicates that this surface is a backbuffer.  It is generally
  502.   set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
  503.   It indicates that this surface is THE back buffer of a surface
  504.   flipping structure.  DirectDraw supports N surfaces in a
  505.   surface flipping structure.  Only the surface that immediately
  506.   precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
  507.   The other surfaces are identified as back buffers by the presence
  508.   of the DDSCAPS_FLIP capability, their attachment order, and the
  509.   absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
  510.   capabilities.  The bit is sent to CreateSurface when a standalone
  511.   back buffer is being created.  This surface could be attached to
  512.   a front buffer and/or back buffers to form a flipping surface
  513.   structure after the CreateSurface call.  See AddAttachments for
  514.   a detailed description of the behaviors in this case. }
  515.   DDSCAPS_BACKBUFFER                      = $00000004 ;
  516.  
  517. { Indicates a complex surface structure is being described.  A
  518.   complex surface structure results in the creation of more than
  519.   one surface.  The additional surfaces are attached to the root
  520.   surface.  The complex structure can only be destroyed by
  521.   destroying the root. }
  522.   DDSCAPS_COMPLEX                         = $00000008 ;
  523.  
  524. { Indicates that this surface is a part of a surface flipping structure.
  525.   When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
  526.   DDSCAP_BACKBUFFER bits are not set.  They are set by CreateSurface
  527.   on the resulting creations.  The dwBackBufferCount field in the
  528.   DDSURFACEDESC structure must be set to at least 1 in order for
  529.   the CreateSurface call to succeed.  The DDSCAPS_COMPLEX capability
  530.   must always be set with creating multiple surfaces through CreateSurface. }
  531.   DDSCAPS_FLIP                            = $00000010 ;
  532.  
  533. { Indicates that this surface is THE front buffer of a surface flipping
  534.   structure.  It is generally set by CreateSurface when the DDSCAPS_FLIP
  535.   capability bit is set.
  536.   If this capability is sent to CreateSurface then a standalone front buffer
  537.   is created.  This surface will not have the DDSCAPS_FLIP capability.
  538.   It can be attached to other back buffers to form a flipping structure.
  539.   See AddAttachments for a detailed description of the behaviors in this
  540.   case. }
  541.   DDSCAPS_FRONTBUFFER                     = $00000020 ;
  542.  
  543. { Indicates that this surface is any offscreen surface that is not an overlay,
  544.   texture, zbuffer, front buffer, back buffer, or alpha surface.  It is used
  545.   to identify plain vanilla surfaces. }
  546.   DDSCAPS_OFFSCREENPLAIN                  = $00000040 ;
  547.  
  548. { Indicates that this surface is an overlay.  It may or may not be directly visible
  549.   depending on whether or not it is currently being overlayed onto the primary
  550.   surface.  DDSCAPS_VISIBLE can be used to determine whether or not it is being
  551.   overlayed at the moment. }
  552.   DDSCAPS_OVERLAY                         = $00000080 ;
  553.  
  554. { Indicates that unique DirectDrawPalette objects can be created and
  555.   attached to this surface. }
  556.   DDSCAPS_PALETTE                         = $00000100 ;
  557.  
  558. { Indicates that this surface is the primary surface.  The primary
  559.   surface represents what the user is seeing at the moment. }
  560.   DDSCAPS_PRIMARYSURFACE                  = $00000200 ;
  561.  
  562. { Indicates that this surface is the primary surface for the left eye.
  563.   The primary surface for the left eye represents what the user is seeing
  564.   at the moment with the users left eye.  When this surface is created the
  565.   DDSCAPS_PRIMARYSURFACE represents what the user is seeing with the users
  566.   right eye. }
  567.   DDSCAPS_PRIMARYSURFACELEFT              = $00000400 ;
  568.  
  569. { Indicates that this surface memory was allocated in system memory }
  570.   DDSCAPS_SYSTEMMEMORY                    = $00000800 ;
  571.  
  572. { Indicates that this surface can be used as a 3D texture.  It does not
  573.   indicate whether or not the surface is being used for that purpose. }
  574.   DDSCAPS_TEXTUREMAP                      = $00001000 ;
  575.  
  576. { Indicates that this surface exists in video memory. }
  577.   DDSCAPS_VIDEOMEMORY                     = $00004000 ;
  578.  
  579. { Indicates that changes made to this surface are immediately visible.
  580.   It is always set for the primary surface and is set for overlays while
  581.   they are being overlayed and texture maps while they are being textured. }
  582.   DDSCAPS_VISIBLE                         = $00008000 ;
  583.  
  584. { Indicates that only writes are permitted to the surface.  Read accesses
  585.   from the surface may or may not generate a protection fault, but the
  586.   results of a read from this surface will not be meaningful.  READ ONLY. }
  587.   DDSCAPS_WRITEONLY                       = $00010000 ;
  588.  
  589. { Indicates that this surface is the z buffer.  The z buffer does not contain
  590.   displayable information.  Instead it contains bit depth information that is
  591.   used to determine which pixels are visible and which are obscured. }
  592.   DDSCAPS_ZBUFFER                         = $00020000 ;
  593.  
  594. { Indicates surface will have a DC associated long term }
  595.   DDSCAPS_OWNDC                           = $00040000 ;
  596.  
  597. { Indicates surface should be able to receive live video }
  598.   DDSCAPS_LIVEVIDEO                       = $00080000 ;
  599.  
  600. { Indicates surface should be able to have a stream decompressed
  601.   to it by the hardware. }
  602.   DDSCAPS_HWCODEC                         = $00100000 ;
  603.  
  604. { Surface is a 320x200 or 320x240 ModeX surface }
  605.   DDSCAPS_MODEX                           = $00200000 ;
  606.  
  607. {****************************************************************************
  608.  *
  609.  * DIRECTDRAW DRIVER CAPABILITY FLAGS
  610.  *
  611.  ****************************************************************************}
  612.  
  613. { Display hardware has 3D acceleration. }
  614.   DDCAPS_3D                       = $00000001 ;
  615.  
  616. { Indicates that DirectDraw will support only dest rectangles that are aligned
  617.   on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively.
  618.   READ ONLY. }
  619.   DDCAPS_ALIGNBOUNDARYDEST        = $00000002 ;
  620.  
  621. { Indicates that DirectDraw will support only source rectangles  whose sizes in
  622.   BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively.  READ ONLY. }
  623.   DDCAPS_ALIGNSIZEDEST            = $00000004 ;
  624.  
  625. { Indicates that DirectDraw will support only source rectangles that are aligned
  626.   on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively.
  627.   READ ONLY. }
  628.   DDCAPS_ALIGNBOUNDARYSRC         = $00000008 ;
  629.  
  630. { Indicates that DirectDraw will support only source rectangles  whose sizes in
  631.   BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively.  READ ONLY. }
  632.   DDCAPS_ALIGNSIZESRC             = $00000010 ;
  633.  
  634. { Indicates that DirectDraw will create video memory surfaces that have a stride
  635.   alignment equal to DIRECTDRAWCAPS.dwAlignStride.  READ ONLY. }
  636.   DDCAPS_ALIGNSTRIDE              = $00000020 ;
  637.  
  638. { Display hardware is capable of blt operations. }
  639.   DDCAPS_BLT                      = $00000040 ;
  640.  
  641. { Display hardware is capable of asynchronous blt operations. }
  642.   DDCAPS_BLTQUEUE                 = $00000080 ;
  643.  
  644. { Display hardware is capable of color space conversions during the blt operation. }
  645.   DDCAPS_BLTFOURCC                = $00000100 ;
  646.  
  647. { Display hardware is capable of stretching during blt operations. }
  648.   DDCAPS_BLTSTRETCH               = $00000200 ;
  649.  
  650. { Display hardware is shared with GDI. }
  651.   DDCAPS_GDI                      = $00000400 ;
  652.  
  653. { Display hardware can overlay. }
  654.   DDCAPS_OVERLAY                  = $00000800 ;
  655.  
  656. { Set if display hardware supports overlays but can not clip them. }
  657.   DDCAPS_OVERLAYCANTCLIP          = $00001000 ;
  658.  
  659. { Indicates that overlay hardware is capable of color space conversions during
  660.   the overlay operation. }
  661.   DDCAPS_OVERLAYFOURCC            = $00002000 ;
  662.  
  663. { Indicates that stretching can be done by the overlay hardware. }
  664.   DDCAPS_OVERLAYSTRETCH           = $00004000 ;
  665.  
  666. { Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces
  667.   other than the primary surface. }
  668.   DDCAPS_PALETTE                  = $00008000 ;
  669.  
  670. { Indicates that palette changes can be syncd with the veritcal refresh. }
  671.   DDCAPS_PALETTEVSYNC             = $00010000 ;
  672.  
  673. { Display hardware can return the current scan line. }
  674.   DDCAPS_READSCANLINE             = $00020000 ;
  675.  
  676. { Display hardware has stereo vision capabilities.  DDSCAPS_PRIMARYSURFACELEFT
  677.   can be created. }
  678.   DDCAPS_STEREOVIEW               = $00040000 ;
  679.  
  680. { Display hardware is capable of generating a vertical blank interrupt. }
  681.   DDCAPS_VBI                      = $00080000 ;
  682.  
  683. { Supports the use of z buffers with blt operations. }
  684.   DDCAPS_ZBLTS                    = $00100000 ;
  685.  
  686. { Supports Z Ordering of overlays. }
  687.   DDCAPS_ZOVERLAYS                = $00200000 ;
  688.  
  689. { Supports color key }
  690.   DDCAPS_COLORKEY                 = $00400000 ;
  691.  
  692. { Supports alpha surfaces }
  693.   DDCAPS_ALPHA                    = $00800000 ;
  694.  
  695. { colorkey is hardware assisted(DDCAPS_COLORKEY will also be set) }
  696.   DDCAPS_COLORKEYHWASSIST         = $01000000 ;
  697.  
  698. { no hardware support at all }
  699.   DDCAPS_NOHARDWARE               = $02000000 ;
  700.  
  701. { Display hardware is capable of color fill with bltter }
  702.   DDCAPS_BLTCOLORFILL             = $04000000 ;
  703.  
  704. { Display hardware is bank switched, and potentially very slow at
  705.   random access to VRAM. }
  706.   DDCAPS_BANKSWITCHED             = $08000000 ;
  707.  
  708. {****************************************************************************
  709.  *
  710.  * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
  711.  *
  712.  ****************************************************************************}
  713.  
  714. { Display hardware is certified }
  715.   DDCAPS2_CERTIFIED               = $00000001 ;
  716.  
  717. {****************************************************************************
  718.  *
  719.  * DIRECTDRAW FX ALPHA CAPABILITY FLAGS
  720.  *
  721.  ****************************************************************************}
  722.  
  723. { Supports alpha blending around the edge of a source color keyed surface.
  724.   For Blt. }
  725.   DDFXALPHACAPS_BLTALPHAEDGEBLEND         = $00000001 ;
  726.  
  727. { Supports alpha information in the pixel format.  The bit depth of alpha
  728.   information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
  729.   more opaque as the alpha value increases.  (0 is transparent.)
  730.   For Blt. }
  731.   DDFXALPHACAPS_BLTALPHAPIXELS            = $00000002 ;
  732.  
  733. { Supports alpha information in the pixel format.  The bit depth of alpha
  734.   information in the pixel format can be 1,2,4, or 8.  The alpha value
  735.   becomes more transparent as the alpha value increases.  (0 is opaque.)
  736.   This flag can only be set if DDCAPS_ALPHA is set.
  737.   For Blt. }
  738.   DDFXALPHACAPS_BLTALPHAPIXELSNEG         = $00000004 ;
  739.  
  740. { Supports alpha only surfaces.  The bit depth of an alpha only surface can be
  741.   1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
  742.   (0 is transparent.)
  743.   For Blt. }
  744.   DDFXALPHACAPS_BLTALPHASURFACES          = $00000008 ;
  745.  
  746. { The depth of the alpha channel data can range can be 1,2,4, or 8.  
  747.   The NEG suffix indicates that this alpha channel becomes more transparent
  748.   as the alpha value increases. (0 is opaque.)  This flag can only be set if
  749.   DDCAPS_ALPHA is set.
  750.   For Blt. }
  751.   DDFXALPHACAPS_BLTALPHASURFACESNEG       = $00000010 ;
  752.  
  753. { Supports alpha blending around the edge of a source color keyed surface.
  754.   For Overlays. }
  755.   DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND     = $00000020 ;
  756.  
  757. { Supports alpha information in the pixel format.  The bit depth of alpha 
  758.   information in the pixel format can be 1,2,4, or 8.  The alpha value becomes
  759.   more opaque as the alpha value increases.  (0 is transparent.)
  760.   For Overlays. }
  761.   DDFXALPHACAPS_OVERLAYALPHAPIXELS        = $00000040 ;
  762.  
  763. { Supports alpha information in the pixel format.  The bit depth of alpha 
  764.   information in the pixel format can be 1,2,4, or 8.  The alpha value 
  765.   becomes more transparent as the alpha value increases.  (0 is opaque.) 
  766.   This flag can only be set if DDCAPS_ALPHA is set.
  767.   For Overlays. }
  768.   DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG     = $00000080 ;
  769.  
  770. { Supports alpha only surfaces.  The bit depth of an alpha only surface can be
  771.   1,2,4, or 8.  The alpha value becomes more opaque as the alpha value increases.
  772.   (0 is transparent.)
  773.   For Overlays. }
  774.   DDFXALPHACAPS_OVERLAYALPHASURFACES      = $00000100 ;
  775.  
  776. { The depth of the alpha channel data can range can be 1,2,4, or 8.
  777.   The NEG suffix indicates that this alpha channel becomes more transparent
  778.   as the alpha value increases. (0 is opaque.)  This flag can only be set if
  779.   DDCAPS_ALPHA is set.
  780.   For Overlays. }
  781.   DDFXALPHACAPS_OVERLAYALPHASURFACESNEG   = $00000200 ;
  782.  
  783. {****************************************************************************
  784.  *
  785.  * DIRECTDRAW FX CAPABILITY FLAGS
  786.  *
  787.  ****************************************************************************}
  788.  
  789. { Uses arithmetic operations to stretch and shrink surfaces during blt
  790.   rather than pixel doubling techniques.  Along the Y axis. }
  791.   DDFXCAPS_BLTARITHSTRETCHY       = $00000020 ;
  792.  
  793. { Uses arithmetic operations to stretch during blt
  794.   rather than pixel doubling techniques.  Along the Y axis. Only
  795.   works for x1, x2, etc. }
  796.   DDFXCAPS_BLTARITHSTRETCHYN      = $00000010 ;
  797.  
  798. { Supports mirroring left to right in blt. }
  799.   DDFXCAPS_BLTMIRRORLEFTRIGHT     = $00000040 ;
  800.  
  801. { Supports mirroring top to bottom in blt. }
  802.   DDFXCAPS_BLTMIRRORUPDOWN        = $00000080 ;
  803.  
  804. { Supports arbitrary rotation for blts. }
  805.   DDFXCAPS_BLTROTATION            = $00000100 ;
  806.  
  807. { Supports 90 degree rotations for blts. }
  808.   DDFXCAPS_BLTROTATION90          = $00000200 ;
  809.  
  810. { DirectDraw supports arbitrary shrinking of a surface along the
  811.   x axis (horizontal direction) for blts. }
  812.   DDFXCAPS_BLTSHRINKX             = $00000400 ;
  813.  
  814. { DirectDraw supports integer shrinking (1x,2x,) of a surface
  815.   along the x axis (horizontal direction) for blts. }
  816.   DDFXCAPS_BLTSHRINKXN            = $00000800 ;
  817.  
  818. { DirectDraw supports arbitrary shrinking of a surface along the
  819.   y axis (horizontal direction) for blts. }  
  820.   DDFXCAPS_BLTSHRINKY             = $00001000 ;
  821.  
  822. { DirectDraw supports integer shrinking (1x,2x,) of a surface
  823.   along the y axis (vertical direction) for blts. }  
  824.   DDFXCAPS_BLTSHRINKYN            = $00002000 ;
  825.  
  826. { DirectDraw supports arbitrary stretching of a surface along the
  827.   x axis (horizontal direction) for blts. }
  828.   DDFXCAPS_BLTSTRETCHX            = $00004000 ;
  829.  
  830. { DirectDraw supports integer stretching (1x,2x,) of a surface
  831.   along the x axis (horizontal direction) for blts. }
  832.   DDFXCAPS_BLTSTRETCHXN           = $00008000 ;
  833.  
  834. { DirectDraw supports arbitrary stretching of a surface along the
  835.   y axis (horizontal direction) for blts. }  
  836.   DDFXCAPS_BLTSTRETCHY            = $00010000 ;
  837.  
  838. { DirectDraw supports integer stretching (1x,2x,) of a surface
  839.   along the y axis (vertical direction) for blts. }  
  840.   DDFXCAPS_BLTSTRETCHYN           = $00020000 ;
  841.  
  842. { Uses arithmetic operations to stretch and shrink surfaces during 
  843.   overlay rather than pixel doubling techniques.  Along the Y axis 
  844.   for overlays. }
  845.   DDFXCAPS_OVERLAYARITHSTRETCHY   = $00040000 ;
  846.  
  847. { Uses arithmetic operations to stretch surfaces during 
  848.   overlay rather than pixel doubling techniques.  Along the Y axis 
  849.   for overlays. Only works for x1, x2, etc. }
  850.   DDFXCAPS_OVERLAYARITHSTRETCHYN  = $00000008 ;
  851.  
  852. { DirectDraw supports arbitrary shrinking of a surface along the
  853.   x axis (horizontal direction) for overlays. }
  854.   DDFXCAPS_OVERLAYSHRINKX         = $00080000 ;
  855.  
  856. { DirectDraw supports integer shrinking (1x,2x,) of a surface
  857.   along the x axis (horizontal direction) for overlays. }
  858.   DDFXCAPS_OVERLAYSHRINKXN        = $00100000 ;
  859.  
  860. { DirectDraw supports arbitrary shrinking of a surface along the
  861.   y axis (horizontal direction) for overlays. }  
  862.   DDFXCAPS_OVERLAYSHRINKY         = $00200000 ;
  863.  
  864. { DirectDraw supports integer shrinking (1x,2x,) of a surface
  865.   along the y axis (vertical direction) for overlays. }  
  866.   DDFXCAPS_OVERLAYSHRINKYN        = $00400000 ;
  867.  
  868. { DirectDraw supports arbitrary stretching of a surface along the
  869.   x axis (horizontal direction) for overlays. }
  870.   DDFXCAPS_OVERLAYSTRETCHX        = $00800000 ;
  871.  
  872. { DirectDraw supports integer stretching (1x,2x,) of a surface
  873.   along the x axis (horizontal direction) for overlays. }
  874.   DDFXCAPS_OVERLAYSTRETCHXN       = $01000000 ;
  875.  
  876. { DirectDraw supports arbitrary stretching of a surface along the
  877.   y axis (horizontal direction) for overlays. }  
  878.   DDFXCAPS_OVERLAYSTRETCHY        = $02000000 ;
  879.  
  880. { DirectDraw supports integer stretching (1x,2x,) of a surface
  881.   along the y axis (vertical direction) for overlays. }  
  882.   DDFXCAPS_OVERLAYSTRETCHYN       = $04000000 ;
  883.  
  884. { DirectDraw supports mirroring of overlays across the vertical axis }
  885.   DDFXCAPS_OVERLAYMIRRORLEFTRIGHT = $08000000 ;
  886.  
  887. { DirectDraw supports mirroring of overlays across the horizontal axis }
  888.   DDFXCAPS_OVERLAYMIRRORUPDOWN    = $10000000 ;
  889.  
  890. {****************************************************************************
  891.  *
  892.  * DIRECTDRAW STEREO VIEW CAPABILITIES
  893.  *
  894.  ****************************************************************************}
  895.  
  896. { The stereo view is accomplished via enigma encoding. }
  897.   DDSVCAPS_ENIGMA                 = $00000001 ;
  898.  
  899. { The stereo view is accomplished via high frequency flickering. }
  900.   DDSVCAPS_FLICKER                = $00000002 ;
  901.  
  902. { The stereo view is accomplished via red and blue filters applied
  903.   to the left and right eyes.  All images must adapt their colorspaces
  904.   for this process. }
  905.   DDSVCAPS_REDBLUE                = $00000004 ;
  906.  
  907. { The stereo view is accomplished with split screen technology. }
  908.   DDSVCAPS_SPLIT                  = $00000008 ;
  909.  
  910. {****************************************************************************
  911.  *
  912.  * DIRECTDRAWPALETTE CAPABILITIES
  913.  *
  914.  ****************************************************************************}
  915.  
  916. { Index is 4 bits.  There are sixteen color entries in the palette table. }
  917.   DDPCAPS_4BIT                    = $00000001 ;
  918.  
  919. { Index is onto a 8 bit color index.  This field is only valid with the
  920.   DDPCAPS_4BIT capability and the target surface is in 8bpp. Each color
  921.   entry is one byte long and is an index into destination surface's 8bpp
  922.   palette. }
  923.   DDPCAPS_8BITENTRIES             = $00000002 ;
  924.  
  925. { Index is 8 bits.  There are 256 color entries in the palette table. }
  926.   DDPCAPS_8BIT                    = $00000004 ;
  927.  
  928. { Indicates that this DIRECTDRAWPALETTE should use the palette color array
  929.   passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE
  930.   object. }
  931.   DDPCAPS_INITIALIZE              = $00000008 ;
  932.  
  933. { This palette is the one attached to the primary surface.  Changing this
  934.   table has immediate effect on the display unless DDPSETPAL_VSYNC is specified
  935.   and supported. }
  936.   DDPCAPS_PRIMARYSURFACE          = $00000010 ;
  937.  
  938. { This palette is the one attached to the primary surface left.  Changing
  939.   this table has immediate effect on the display for the left eye unless
  940.   DDPSETPAL_VSYNC is specified and supported. }
  941.   DDPCAPS_PRIMARYSURFACELEFT      = $00000020 ;
  942.  
  943. { This palette can have all 256 entries defined }
  944.   DDPCAPS_ALLOW256                = $00000040 ;
  945.  
  946. { This palette can have modifications to it synced with the monitors
  947.   refresh rate. }
  948.   DDPCAPS_VSYNC                   = $00000080 ;
  949.  
  950.  
  951. {****************************************************************************
  952.  *
  953.  * DIRECTDRAWPALETTE SETENTRY CONSTANTS
  954.  *
  955.  ****************************************************************************}
  956.  
  957. { Palette changes take effect immediately. }
  958.   DDPSETPAL_IMMEDIATE             = $00000000 ;    { default }
  959.  
  960. { Palette changes should take effect during the vertical blank to avoid
  961.   palette tearing. }
  962.   DDPSETPAL_VSYNC                 = $00000002 ;
  963.  
  964. {****************************************************************************
  965.  *
  966.  * DIRECTDRAWPALETTE GETENTRY CONSTANTS
  967.  *
  968.  ****************************************************************************}
  969.  
  970. { 0 is the only legal value }
  971.  
  972. {****************************************************************************
  973.  *
  974.  * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
  975.  *
  976.  ****************************************************************************}
  977.  
  978. { Palette change takes effect immediately. }
  979.   DDSETPAL_IMMEDIATE              = $00000000 ;    { default }
  980.  
  981. { Palette change should take effect during the vertical blank to avoid
  982.   palette tearing. }
  983.   DDSETPAL_VSYNC                  = $00000002 ;
  984.  
  985. {****************************************************************************
  986.  *
  987.  * DIRECTDRAW BITDEPTH CONSTANTS
  988.  *
  989.  * NOTE:  These are only used to indicate supported bit depths.   These
  990.  * are flags only, they are not to be used as an actual bit depth.   The
  991.  * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
  992.  * bit depths in a surface or for changing the display mode.
  993.  *
  994.  ****************************************************************************}
  995.  
  996. { 1 bit per pixel. }
  997.   DDBD_1                  = $00004000 ;
  998.  
  999. { 2 bits per pixel. }
  1000.   DDBD_2                  = $00002000 ;
  1001.  
  1002. { 4 bits per pixel. }
  1003.   DDBD_4                  = $00001000 ;
  1004.  
  1005. { 8 bits per pixel. }
  1006.   DDBD_8                  = $00000800 ;
  1007.  
  1008. { 16 bits per pixel. }
  1009.   DDBD_16                 = $00000400 ;
  1010.  
  1011. { 24 bits per pixel. }
  1012.   DDBD_24                 = $00000200 ;
  1013.  
  1014. { 32 bits per pixel. }
  1015.   DDBD_32                 = $00000100 ;
  1016.  
  1017. {****************************************************************************
  1018.  *
  1019.  * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS
  1020.  *
  1021.  ****************************************************************************}
  1022.  
  1023. { Set if the structure contains a color space.  Not set if the structure
  1024.   contains a single color key. }
  1025.   DDCKEY_COLORSPACE       = $00000001 ;
  1026.  
  1027. { Set if the structure specifies a color key or color space which is to be
  1028.   used as a destination color key for blt operations. }
  1029.   DDCKEY_DESTBLT          = $00000002 ;
  1030.  
  1031. { Set if the structure specifies a color key or color space which is to be
  1032.   used as a destination color key for overlay operations. }
  1033.   DDCKEY_DESTOVERLAY      = $00000004 ;
  1034.  
  1035. { Set if the structure specifies a color key or color space which is to be
  1036.   used as a source color key for blt operations. }
  1037.   DDCKEY_SRCBLT           = $00000008 ;
  1038.  
  1039. { Set if the structure specifies a color key or color space which is to be
  1040.   used as a source color key for overlay operations. }
  1041.   DDCKEY_SRCOVERLAY       = $00000010 ;
  1042.  
  1043.  
  1044. {****************************************************************************
  1045.  *
  1046.  * DIRECTDRAW COLOR KEY CAPABILITY FLAGS
  1047.  *
  1048.  ****************************************************************************}
  1049.  
  1050. { Supports transparent blting using a color key to identify the replaceable
  1051.   bits of the destination surface for RGB colors. }
  1052.   DDCKEYCAPS_DESTBLT                      = $00000001 ;
  1053.  
  1054. { Supports transparent blting using a color space to identify the replaceable
  1055.   bits of the destination surface for RGB colors. }
  1056.   DDCKEYCAPS_DESTBLTCLRSPACE              = $00000002 ;
  1057.  
  1058. { Supports transparent blting using a color space to identify the replaceable
  1059.   bits of the destination surface for YUV colors. }
  1060.   DDCKEYCAPS_DESTBLTCLRSPACEYUV           = $00000004 ;
  1061.  
  1062. { Supports transparent blting using a color key to identify the replaceable 
  1063.   bits of the destination surface for YUV colors. }
  1064.   DDCKEYCAPS_DESTBLTYUV                   = $00000008 ;
  1065.  
  1066. { Supports overlaying using colorkeying of the replaceable bits of the surface
  1067.   being overlayed for RGB colors. }
  1068.   DDCKEYCAPS_DESTOVERLAY                  = $00000010 ;
  1069.  
  1070. { Supports a color space as the color key for the destination for RGB colors. }
  1071.   DDCKEYCAPS_DESTOVERLAYCLRSPACE          = $00000020 ;
  1072.  
  1073. { Supports a color space as the color key for the destination for YUV colors. }
  1074.   DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV       = $00000040 ;
  1075.  
  1076. { Supports only one active destination color key value for visible overlay
  1077.   surfaces. }
  1078.   DDCKEYCAPS_DESTOVERLAYONEACTIVE         = $00000080 ;
  1079.  
  1080. { Supports overlaying using colorkeying of the replaceable bits of the 
  1081.   surface being overlayed for YUV colors. }
  1082.   DDCKEYCAPS_DESTOVERLAYYUV               = $00000100 ;
  1083.  
  1084. { Supports transparent blting using the color key for the source with
  1085.   this surface for RGB colors. }
  1086.   DDCKEYCAPS_SRCBLT                       = $00000200 ;
  1087.  
  1088. { Supports transparent blting using a color space for the source with
  1089.   this surface for RGB colors. }
  1090.   DDCKEYCAPS_SRCBLTCLRSPACE               = $00000400 ;
  1091.  
  1092. { Supports transparent blting using a color space for the source with
  1093.   this surface for YUV colors. }
  1094.   DDCKEYCAPS_SRCBLTCLRSPACEYUV            = $00000800 ;
  1095.  
  1096. { Supports transparent blting using the color key for the source with
  1097.   this surface for YUV colors. }
  1098.   DDCKEYCAPS_SRCBLTYUV                    = $00001000 ;
  1099.  
  1100. { Supports overlays using the color key for the source with this
  1101.   overlay surface for RGB colors. }
  1102.   DDCKEYCAPS_SRCOVERLAY                   = $00002000 ;
  1103.  
  1104. { Supports overlays using a color space as the source color key for
  1105.   the overlay surface for RGB colors. }
  1106.   DDCKEYCAPS_SRCOVERLAYCLRSPACE           = $00004000 ;
  1107.  
  1108. { Supports overlays using a color space as the source color key for
  1109.   the overlay surface for YUV colors. }
  1110.   DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV        = $00008000 ;
  1111.  
  1112. { Supports only one active source color key value for visible
  1113.   overlay surfaces. }
  1114.   DDCKEYCAPS_SRCOVERLAYONEACTIVE          = $00010000 ;
  1115.  
  1116. { Supports overlays using the color key for the source with this
  1117.   overlay surface for YUV colors. }
  1118.   DDCKEYCAPS_SRCOVERLAYYUV                = $00020000 ;
  1119.  
  1120. { there are no bandwidth trade-offs for using colorkey with an overlay }
  1121.   DDCKEYCAPS_NOCOSTOVERLAY                = $00040000 ;
  1122.  
  1123.  
  1124. {****************************************************************************
  1125.  *
  1126.  * DIRECTDRAW PIXELFORMAT FLAGS
  1127.  *
  1128.  ****************************************************************************}
  1129.  
  1130. { The surface has alpha channel information in the pixel format. }
  1131.   DDPF_ALPHAPIXELS                        = $00000001 ;
  1132.  
  1133. { The pixel format contains alpha only information }
  1134.   DDPF_ALPHA                              = $00000002 ;
  1135.  
  1136. { The FourCC code is valid. }
  1137.   DDPF_FOURCC                             = $00000004 ;
  1138.  
  1139. { The surface is 4-bit color indexed. }
  1140.   DDPF_PALETTEINDEXED4                    = $00000008 ;
  1141.  
  1142. { The surface is 4-bit color indexed to an 8-bit palette. }
  1143.   DDPF_PALETTEINDEXED4TO8                 = $00000010 ;
  1144.  
  1145. { The surface is 8-bit color indexed. }
  1146.   DDPF_PALETTEINDEXED8                    = $00000020 ;
  1147.  
  1148. { The RGB data in the pixel format structure is valid. }
  1149.   DDPF_RGB                                = $00000040 ;
  1150.  
  1151. { The surface will accept pixel data in the format specified
  1152.   and compress it during the write. }
  1153.   DDPF_COMPRESSED                         = $00000080 ;
  1154.  
  1155. { The surface will accept RGB data and translate it during
  1156.   the write to YUV data.  The format of the data to be written
  1157.   will be contained in the pixel format structure.  The DDPF_RGB
  1158.   flag will be set. } 
  1159.   DDPF_RGBTOYUV                           = $00000100 ;
  1160.  
  1161. { pixel format is YUV - YUV data in pixel format struct is valid }
  1162.   DDPF_YUV                                = $00000200 ;
  1163.  
  1164. { pixel format is a z buffer only surface }
  1165.   DDPF_ZBUFFER                            = $00000400 ;
  1166.  
  1167. {*===========================================================================
  1168.  *
  1169.  *
  1170.  * DIRECTDRAW CALLBACK FLAGS
  1171.  *
  1172.  *
  1173.  *==========================================================================*}
  1174.  
  1175. {****************************************************************************
  1176.  *
  1177.  * DIRECTDRAW ENUMSURFACES FLAGS
  1178.  *
  1179.  ****************************************************************************}
  1180.  
  1181. { Enumerate all of the surfaces that meet the search criterion. }
  1182.   DDENUMSURFACES_ALL                      = $00000001 ;
  1183.  
  1184. { A search hit is a surface that matches the surface description. }
  1185.   DDENUMSURFACES_MATCH                    = $00000002 ;
  1186.  
  1187. { A search hit is a surface that does not match the surface description. }
  1188.   DDENUMSURFACES_NOMATCH                  = $00000004 ;
  1189.  
  1190. { Enumerate the first surface that can be created which meets the search criterion. }
  1191.   DDENUMSURFACES_CANBECREATED             = $00000008 ;
  1192.  
  1193. { Enumerate the surfaces that already exist that meet the search criterion. }
  1194.   DDENUMSURFACES_DOESEXIST                = $00000010 ;
  1195.  
  1196.  
  1197. {****************************************************************************
  1198.  *
  1199.  * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS
  1200.  *
  1201.  ****************************************************************************}
  1202.  
  1203. { Exclusive mode owner will be responsible for the entire primary surface.
  1204.   GDI can be ignored. used with DD }
  1205.   DDSCL_FULLSCREEN                        = $00000001 ;
  1206.  
  1207. { allow CTRL_ALT_DEL to work while in fullscreen exclusive mode } 
  1208.   DDSCL_ALLOWREBOOT                       = $00000002 ;
  1209.  
  1210. { prevents DDRAW from modifying the application window.
  1211.   prevents DDRAW from minimize/restore the application window on activation. }
  1212.   DDSCL_NOWINDOWCHANGES                   = $00000004 ;
  1213.  
  1214. { app wants to work as a regular Windows application }
  1215.   DDSCL_NORMAL                            = $00000008 ;
  1216.  
  1217. { app wants exclusive access }
  1218.   DDSCL_EXCLUSIVE                         = $00000010 ;
  1219.  
  1220.  
  1221. { app can deal with non-windows display modes }
  1222.   DDSCL_ALLOWMODEX                        = $00000040 ;
  1223.  
  1224.  
  1225. {****************************************************************************
  1226.  *
  1227.  * DIRECTDRAW BLT FLAGS
  1228.  *
  1229.  ****************************************************************************}
  1230.  
  1231. { Use the alpha information in the pixel format or the alpha channel surface
  1232.   attached to the destination surface as the alpha channel for this blt. }
  1233.   DDBLT_ALPHADEST                         = $00000001 ;
  1234.  
  1235. { Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel
  1236.   for the destination surface for this blt. }
  1237.   DDBLT_ALPHADESTCONSTOVERRIDE            = $00000002 ;
  1238.  
  1239. { The NEG suffix indicates that the destination surface becomes more
  1240.   transparent as the alpha value increases. (0 is opaque) }
  1241.   DDBLT_ALPHADESTNEG                      = $00000004 ;
  1242.  
  1243. { Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha
  1244.   channel for the destination for this blt. }
  1245.   DDBLT_ALPHADESTSURFACEOVERRIDE          = $00000008 ;
  1246.  
  1247. { Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel
  1248.   for the edges of the image that border the color key colors. }
  1249.   DDBLT_ALPHAEDGEBLEND                    = $00000010 ;
  1250.  
  1251. { Use the alpha information in the pixel format or the alpha channel surface
  1252.   attached to the source surface as the alpha channel for this blt. }
  1253.   DDBLT_ALPHASRC                          = $00000020 ;
  1254.  
  1255. { Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel
  1256.   for the source for this blt. }
  1257.   DDBLT_ALPHASRCCONSTOVERRIDE             = $00000040 ;
  1258.  
  1259. { The NEG suffix indicates that the source surface becomes more transparent
  1260.   as the alpha value increases. (0 is opaque) }
  1261.   DDBLT_ALPHASRCNEG                       = $00000080 ;
  1262.  
  1263. { Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel
  1264.   for the source for this blt. } 
  1265.   DDBLT_ALPHASRCSURFACEOVERRIDE           = $00000100 ;
  1266.  
  1267. { Do this blt asynchronously through the FIFO in the order received.  If
  1268.   there is no room in the hardware FIFO fail the call. }
  1269.   DDBLT_ASYNC                             = $00000200 ;
  1270.  
  1271. { Uses the dwFillColor field in the DDBLTFX structure as the RGB color
  1272.   to fill the destination rectangle on the destination surface with. }
  1273.   DDBLT_COLORFILL                         = $00000400 ;
  1274.  
  1275. { Uses the dwDDFX field in the DDBLTFX structure to specify the effects
  1276.   to use for the blt. }
  1277.   DDBLT_DDFX                              = $00000800 ;
  1278.  
  1279. { Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS
  1280.   that are not part of the Win32 API. }
  1281.   DDBLT_DDROPS                            = $00001000 ;
  1282.  
  1283. { Use the color key associated with the destination surface. }
  1284.   DDBLT_KEYDEST                           = $00002000 ;
  1285.  
  1286. { Use the dckDestColorkey field in the DDBLTFX structure as the color key
  1287.   for the destination surface. }
  1288.   DDBLT_KEYDESTOVERRIDE                   = $00004000 ;
  1289.  
  1290. { Use the color key associated with the source surface. }
  1291.   DDBLT_KEYSRC                            = $00008000 ;
  1292.  
  1293. { Use the dckSrcColorkey field in the DDBLTFX structure as the color key
  1294.   for the source surface. }
  1295.   DDBLT_KEYSRCOVERRIDE                    = $00010000 ;
  1296.  
  1297. { Use the dwROP field in the DDBLTFX structure for the raster operation
  1298.   for this blt.  These ROPs are the same as the ones defined in the Win32 API. }
  1299.   DDBLT_ROP                               = $00020000 ;
  1300.  
  1301. { Use the dwRotationAngle field in the DDBLTFX structure as the angle
  1302.   (specified in 1/100th of a degree) to rotate the surface. }
  1303.   DDBLT_ROTATIONANGLE                     = $00040000 ;
  1304.  
  1305. { Z-buffered blt using the z-buffers attached to the source and destination
  1306.   surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the
  1307.   z-buffer opcode. }
  1308.   DDBLT_ZBUFFER                           = $00080000 ;
  1309.  
  1310. { Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field
  1311.   in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
  1312.   for the destination. }
  1313.   DDBLT_ZBUFFERDESTCONSTOVERRIDE          = $00100000 ;
  1314.  
  1315. { Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode
  1316.   field in the DDBLTFX structure as the z-buffer and z-buffer opcode
  1317.   respectively for the destination. }
  1318.   DDBLT_ZBUFFERDESTOVERRIDE               = $00200000 ;
  1319.  
  1320. { Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field
  1321.   in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
  1322.   for the source. }
  1323.   DDBLT_ZBUFFERSRCCONSTOVERRIDE           = $00400000 ;
  1324.  
  1325. { Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode
  1326.   field in the DDBLTFX structure as the z-buffer and z-buffer opcode
  1327.   respectively for the source. }
  1328.   DDBLT_ZBUFFERSRCOVERRIDE                = $00800000 ;
  1329.  
  1330. { wait until the device is ready to handle the blt
  1331.   this will cause blt to not return DDERR_WASSTILLDRAWING }
  1332.   DDBLT_WAIT                              = $01000000 ;
  1333.  
  1334.  
  1335. {****************************************************************************
  1336.  *
  1337.  * BLTFAST FLAGS
  1338.  *
  1339.  ****************************************************************************}
  1340.  
  1341.   DDBLTFAST_NOCOLORKEY                    = $0000000 ;
  1342.   DDBLTFAST_SRCCOLORKEY                   = $0000000 ;
  1343.   DDBLTFAST_DESTCOLORKEY                  = $0000000 ;
  1344.   DDBLTFAST_WAIT                          = $0000001 ;
  1345.  
  1346. {****************************************************************************
  1347.  *
  1348.  * LOCK FLAGS
  1349.  *
  1350.  ****************************************************************************}
  1351.  
  1352.   DDLOCK_WAIT                          = $0000000 ;
  1353.   DDLOCK_READONLY                      = $00000010 ; { surface will only be read from }
  1354.   DDLOCK_WRITEONLY                     = $00000020 ; { surface will only be written to }
  1355.  
  1356. {****************************************************************************
  1357.  *
  1358.  * FLIP FLAGS
  1359.  *
  1360.  ****************************************************************************}
  1361.  
  1362.   DDFLIP_WAIT                          = $00000001 ;
  1363.  
  1364.  
  1365. {****************************************************************************
  1366.  *
  1367.  * DIRECTDRAW SURFACE OVERLAY FLAGS
  1368.  *
  1369.  ****************************************************************************}
  1370.  
  1371. { Use the alpha information in the pixel format or the alpha channel surface
  1372.   attached to the destination surface as the alpha channel for the
  1373.   destination overlay. }
  1374.   DDOVER_ALPHADEST                        = $00000001 ;
  1375.  
  1376. { Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the
  1377.   destination alpha channel for this overlay. }
  1378.   DDOVER_ALPHADESTCONSTOVERRIDE           = $00000002 ;
  1379.  
  1380. { The NEG suffix indicates that the destination surface becomes more
  1381.   transparent as the alpha value increases. }
  1382.   DDOVER_ALPHADESTNEG                     = $00000004 ;
  1383.  
  1384. { Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha
  1385.   channel destination for this overlay. }
  1386.   DDOVER_ALPHADESTSURFACEOVERRIDE         = $00000008 ;
  1387.  
  1388. { Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha
  1389.   channel for the edges of the image that border the color key colors. }
  1390.   DDOVER_ALPHAEDGEBLEND                   = $00000010 ;
  1391.  
  1392. { Use the alpha information in the pixel format or the alpha channel surface
  1393.   attached to the source surface as the source alpha channel for this overlay. }
  1394.   DDOVER_ALPHASRC                         = $00000020 ;
  1395.  
  1396. { Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source
  1397.   alpha channel for this overlay. }
  1398.   DDOVER_ALPHASRCCONSTOVERRIDE            = $00000040 ;
  1399.  
  1400. { The NEG suffix indicates that the source surface becomes more transparent
  1401.   as the alpha value increases. }
  1402.   DDOVER_ALPHASRCNEG                      = $00000080 ;
  1403.  
  1404. { Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel
  1405.   source for this overlay. }
  1406.   DDOVER_ALPHASRCSURFACEOVERRIDE          = $00000100 ;
  1407.  
  1408. { Turn this overlay off. }
  1409.   DDOVER_HIDE                             = $00000200 ;
  1410.  
  1411. { Use the color key associated with the destination surface. }
  1412.   DDOVER_KEYDEST                          = $00000400 ;
  1413.  
  1414. { Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key
  1415.   for the destination surface }
  1416.   DDOVER_KEYDESTOVERRIDE                  = $00000800 ;
  1417.  
  1418. { Use the color key associated with the source surface. }
  1419.   DDOVER_KEYSRC                           = $00001000 ;
  1420.  
  1421. { Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key
  1422.   for the source surface. }
  1423.   DDOVER_KEYSRCOVERRIDE                   = $00002000 ;
  1424.  
  1425. { Turn this overlay on. }
  1426.   DDOVER_SHOW                             = $00004000 ;
  1427.  
  1428. { Add a dirty rect to an emulated overlayed surface. }
  1429.   DDOVER_ADDDIRTYRECT                     = $00008000 ;
  1430.  
  1431. { Redraw all dirty rects on an emulated overlayed surface. }
  1432.   DDOVER_REFRESHDIRTYRECTS                = $00010000 ;
  1433.  
  1434. { Redraw the entire surface on an emulated overlayed surface. }
  1435.   DDOVER_REFRESHALL                      = $00020000 ;
  1436.  
  1437. { Force redrawing onto the destination surface without regard for the background }
  1438.   DDOVER_REFRESHPOUND                     = $00040000 ;
  1439.  
  1440. { Use the overlay FX flags to define special overlay FX }
  1441.   DDOVER_DDFX                             = $00080000 ;
  1442.  
  1443.  
  1444. {****************************************************************************
  1445.  *
  1446.  * DIRECTDRAWSURFACE LOCK FLAGS
  1447.  *
  1448.  ****************************************************************************}
  1449.  
  1450. { The default.  Set to indicate that Lock should return a valid memory pointer
  1451.   to the top of the specified rectangle.  If no rectangle is specified then a
  1452.   pointer to the top of the surface is returned. }
  1453.   DDLOCK_SURFACEMEMORYPTR                 = $00000000 ;    { default }
  1454.  
  1455. { Set if an event handle is being passed to Lock.  Lock will trigger the event
  1456.   when it can return the surface memory pointer requested. }
  1457.   DDLOCK_EVENT                            = $00000002 ;
  1458.  
  1459. {****************************************************************************
  1460.  *
  1461.  * DIRECTDRAWSURFACE BLT FX FLAGS
  1462.  *
  1463.  ****************************************************************************}
  1464.  
  1465. { If stretching, use arithmetic stretching along the Y axis for this blt. }
  1466.   DDBLTFX_ARITHSTRETCHY                   = $00000001 ;
  1467.  
  1468. { Do this blt mirroring the surface left to right.  Spin the
  1469.   surface around its y-axis. }
  1470.   DDBLTFX_MIRRORLEFTRIGHT                 = $00000002 ;
  1471.  
  1472. { Do this blt mirroring the surface up and down.  Spin the surface
  1473.   around its x-axis. }
  1474.   DDBLTFX_MIRRORUPDOWN                    = $00000004 ;
  1475.  
  1476. { Schedule this blt to avoid tearing. }
  1477.   DDBLTFX_NOTEARING                       = $00000008 ;
  1478.  
  1479. { Do this blt rotating the surface one hundred and eighty degrees. }
  1480.   DDBLTFX_ROTATE180                       = $00000010 ;
  1481.  
  1482. { Do this blt rotating the surface two hundred and seventy degrees. }
  1483.   DDBLTFX_ROTATE270                       = $00000020 ;
  1484.  
  1485. { Do this blt rotating the surface ninety degrees. }
  1486.   DDBLTFX_ROTATE90                        = $00000040 ;
  1487.  
  1488. { Do this z blt using dwZBufferLow and dwZBufferHigh as  range values
  1489.   specified to limit the bits copied from the source surface. }
  1490.   DDBLTFX_ZBUFFERRANGE                    = $00000080 ;
  1491.  
  1492. { Do this z blt adding the dwZBufferBaseDest to each of the sources z values
  1493.   before comparing it with the desting z values. }
  1494.   DDBLTFX_ZBUFFERBASEDEST                 = $00000100 ;
  1495.  
  1496. {****************************************************************************
  1497.  *
  1498.  * DIRECTDRAWSURFACE OVERLAY FX FLAGS
  1499.  *
  1500.  ****************************************************************************}
  1501.  
  1502. { If stretching, use arithmetic stretching along the Y axis for this overlay. }
  1503.   DDOVERFX_ARITHSTRETCHY                  = $00000001 ;
  1504.  
  1505. { Mirror the overlay across the vertical axis }
  1506.   DDOVERFX_MIRRORLEFTRIGHT                = $00000002 ;
  1507.  
  1508. { Mirror the overlay across the horizontal axis }
  1509.   DDOVERFX_MIRRORUPDOWN                   = $00000004 ;
  1510.  
  1511. {****************************************************************************
  1512.  *
  1513.  * DIRECTDRAW WAITFORVERTICALBLANK FLAGS
  1514.  *
  1515.  ****************************************************************************}
  1516.  
  1517. { return when the vertical blank interval begins }
  1518.   DDWAITVB_BLOCKBEGIN                     = $00000001 ;
  1519.  
  1520. { set up an event to trigger when the vertical blank begins }
  1521.   DDWAITVB_BLOCKBEGINEVENT                = $00000002 ;
  1522.  
  1523. { return when the vertical blank interval ends and display begins }
  1524.   DDWAITVB_BLOCKEND                       = $00000004 ;
  1525.  
  1526. {****************************************************************************
  1527.  *
  1528.  * DIRECTDRAW GETFLIPSTATUS FLAGS
  1529.  *
  1530.  ****************************************************************************}
  1531.  
  1532. { is it OK to flip now? }
  1533.   DDGFS_CANFLIP                   = $00000001 ;
  1534.  
  1535. { is the last flip finished? }
  1536.   DDGFS_ISFLIPDONE                = $00000002 ;
  1537.  
  1538. {****************************************************************************
  1539.  *
  1540.  * DIRECTDRAW GETBLTSTATUS FLAGS
  1541.  *
  1542.  ****************************************************************************}
  1543.  
  1544. { is it OK to blt now? }
  1545.   DDGBS_CANBLT                    = $00000001 ;
  1546.  
  1547. { is the blt to the surface finished? }
  1548.   DDGBS_ISBLTDONE                 = $00000002 ;
  1549.  
  1550.  
  1551. {****************************************************************************
  1552.  *
  1553.  * DIRECTDRAW ENUMOVERLAYZORDER FLAGS
  1554.  *
  1555.  ****************************************************************************}
  1556.  
  1557. { Enumerate overlays back to front. }
  1558.   DDENUMOVERLAYZ_BACKTOFRONT      = $00000000 ;
  1559.  
  1560. { Enumerate overlays front to back }
  1561.   DDENUMOVERLAYZ_FRONTTOBACK      = $00000001 ;
  1562.  
  1563. {****************************************************************************
  1564.  *
  1565.  * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
  1566.  *
  1567.  ****************************************************************************}
  1568.  
  1569. { Send overlay to front }
  1570.   DDOVERZ_SENDTOFRONT             = $00000000 ;
  1571.  
  1572. { Send overlay to back }
  1573.   DDOVERZ_SENDTOBACK              = $00000001 ;
  1574.  
  1575. { Move Overlay forward }
  1576.   DDOVERZ_MOVEFORWARD             = $00000002 ;
  1577.  
  1578. { Move Overlay backward }
  1579.   DDOVERZ_MOVEBACKWARD            = $00000003 ;
  1580.  
  1581. { Move Overlay in front of relative surface }
  1582.   DDOVERZ_INSERTINFRONTOF         = $00000004 ;
  1583.  
  1584. { Move Overlay in back of relative surface }
  1585.   DDOVERZ_INSERTINBACKOF          = $00000005 ;
  1586.  
  1587. {*===========================================================================
  1588.  *
  1589.  *
  1590.  * DIRECTDRAW RETURN CODES
  1591.  *
  1592.  * The return values from DirectDraw Commands and Surface that return an HRESULT
  1593.  * are codes from DirectDraw concerning the results of the action
  1594.  * requested by DirectDraw.
  1595.  *
  1596.  *==========================================================================*}
  1597.  
  1598. const
  1599.  
  1600. { Status is OK
  1601.   Issued by: DirectDraw Commands and all callbacks }
  1602.   DD_OK_HANDLED             = 1 ;
  1603.   DD_OK_NOTHANDLED          = 0 ;
  1604.   DD_OK                     = 0 ;
  1605.  
  1606. {****************************************************************************
  1607.  *
  1608.  * DIRECTDRAW ENUMCALLBACK RETURN VALUES
  1609.  *
  1610.  * EnumCallback returns are used to control the flow of the DIRECTDRAW and
  1611.  * DIRECTDRAWSURFACE object enumerations.   They can only be returned by
  1612.  * enumeration callback routines.
  1613.  *
  1614.  ****************************************************************************}
  1615.  
  1616. { stop the enumeration }
  1617.   DDENUMRET_CANCEL          = 0 ;
  1618.  
  1619. { continue the enumeration }
  1620.   DDENUMRET_OK              = 1 ;
  1621.  
  1622. {****************************************************************************
  1623.  *
  1624.  * DIRECTDRAW ERRORS
  1625.  *
  1626.  * Errors are represented by negative values and cannot be combined.
  1627.  *
  1628.  ****************************************************************************}
  1629.  
  1630. { This object is already initialized }
  1631.   DDERR_ALREADYINITIALIZED                = $88760005 ; { MAKE_DDHRESULT( 5 ) }
  1632.  
  1633. { This surface can not be attached to the requested surface. }
  1634.   DDERR_CANNOTATTACHSURFACE               = $8876000A ; { MAKE_DDHRESULT( 10 ) }
  1635.  
  1636. { This surface can not be detached from the requested surface. }
  1637.   DDERR_CANNOTDETACHSURFACE               = $88760014 ; { MAKE_DDHRESULT( 20 ) }
  1638.  
  1639. { Support is currently not available. }
  1640.   DDERR_CURRENTLYNOTAVAIL                 = $88760028 ; { MAKE_DDHRESULT( 40 ) }
  1641.  
  1642. { An exception was encountered while performing the requested operation }
  1643.   DDERR_EXCEPTION                         = $88760037 ; { MAKE_DDHRESULT( 55 ) }
  1644.  
  1645. { Generic failure. }
  1646.   DDERR_GENERIC                           = E_FAIL ;
  1647.  
  1648. { Height of rectangle provided is not a multiple of reqd alignment }
  1649.   DDERR_HEIGHTALIGN                       = $8876005A ; { MAKE_DDHRESULT( 90 ) }
  1650.  
  1651. { Unable to match primary surface creation request with existing
  1652.   primary surface. }
  1653.   DDERR_INCOMPATIBLEPRIMARY               = $8876005F ; { MAKE_DDHRESULT( 95 ) }
  1654.  
  1655. { One or more of the caps bits passed to the callback are incorrect. }
  1656.   DDERR_INVALIDCAPS                       = $88760064 ; { MAKE_DDHRESULT( 100 ) }
  1657.  
  1658. { DirectDraw does not support provided Cliplist. }
  1659.   DDERR_INVALIDCLIPLIST                   = $8876006E ; { MAKE_DDHRESULT( 110 ) }
  1660.  
  1661. { DirectDraw does not support the requested mode }
  1662.   DDERR_INVALIDMODE                       = $88760078 ; { MAKE_DDHRESULT( 120 ) }
  1663.  
  1664. { DirectDraw received a pointer that was an invalid DIRECTDRAW object. }
  1665.   DDERR_INVALIDOBJECT                     = $88760082 ; { MAKE_DDHRESULT( 130 ) }
  1666.  
  1667. { One or more of the parameters passed to the callback function are
  1668.   incorrect. }
  1669.   DDERR_INVALIDPARAMS                     = E_INVALIDARG ;
  1670.  
  1671. { pixel format was invalid as specified }
  1672.   DDERR_INVALIDPIXELFORMAT                = $88760091 ; { MAKE_DDHRESULT( 145 ) }
  1673.  
  1674. { Rectangle provided was invalid. }
  1675.   DDERR_INVALIDRECT                       = $88760096 ; { MAKE_DDHRESULT( 150 ) }
  1676.  
  1677. { Operation could not be carried out because one or more surfaces are locked }
  1678.   DDERR_LOCKEDSURFACES                    = $887600A0 ; { MAKE_DDHRESULT( 160 ) }
  1679.  
  1680. { There is no 3D present. }
  1681.   DDERR_NO3D                              = $887600AA ; { MAKE_DDHRESULT( 170 ) }
  1682.  
  1683. { Operation could not be carried out because there is no alpha accleration
  1684.   hardware present or available. }
  1685.   DDERR_NOALPHAHW                         = $887600B4 ; { MAKE_DDHRESULT( 180 ) }
  1686.  
  1687. { no clip list available }
  1688.   DDERR_NOCLIPLIST                        = $887600CD ; { MAKE_DDHRESULT( 205 ) }
  1689.  
  1690. { Operation could not be carried out because there is no color conversion
  1691.   hardware present or available. }
  1692.   DDERR_NOCOLORCONVHW                     = $887600D2 ; { MAKE_DDHRESULT( 210 ) }
  1693.  
  1694. { Create function called without DirectDraw object method SetCooperativeLevel
  1695.   being called. }
  1696.   DDERR_NOCOOPERATIVELEVELSET             = $887600D4 ; { MAKE_DDHRESULT( 212 ) }
  1697.  
  1698. { Surface doesn't currently have a color key }
  1699.   DDERR_NOCOLORKEY                        = $887600D7 ; { MAKE_DDHRESULT( 215 ) }
  1700.  
  1701. { Operation could not be carried out because there is no hardware support
  1702.   of the dest color key. }
  1703.   DDERR_NOCOLORKEYHW                      = $887600DC ; { MAKE_DDHRESULT( 220 ) }
  1704.  
  1705. { No DirectDraw support possible with current display driver }
  1706.   DDERR_NODIRECTDRAWSUPPORT               = $887600DE ; { MAKE_DDHRESULT( 222 ) }
  1707.  
  1708. { Operation requires the application to have exclusive mode but the
  1709.   application does not have exclusive mode. }
  1710.   DDERR_NOEXCLUSIVEMODE                   = $887600E1 ; { MAKE_DDHRESULT( 225 ) }
  1711.  
  1712. { Flipping visible surfaces is not supported. }
  1713.   DDERR_NOFLIPHW                          = $887600E6 ; { MAKE_DDHRESULT( 230 ) }
  1714.  
  1715. { There is no GDI present. }
  1716.   DDERR_NOGDI                             = $887600F0 ; { MAKE_DDHRESULT( 240 ) }
  1717.  
  1718. { Operation could not be carried out because there is no hardware present
  1719.   or available. }
  1720.   DDERR_NOMIRRORHW                        = $887600FA ; { MAKE_DDHRESULT( 250 ) }
  1721.  
  1722. { Requested item was not found }
  1723.   DDERR_NOTFOUND                          = $887600FF ; { MAKE_DDHRESULT( 255 ) }
  1724.  
  1725. { Operation could not be carried out because there is no overlay hardware
  1726.   present or available. }
  1727.   DDERR_NOOVERLAYHW                       = $88760104 ; { MAKE_DDHRESULT( 260 ) }
  1728.  
  1729. { Operation could not be carried out because there is no appropriate raster
  1730.   op hardware present or available. }
  1731.   DDERR_NORASTEROPHW                      = $88760118 ; { MAKE_DDHRESULT( 280 ) }
  1732.  
  1733. { Operation could not be carried out because there is no rotation hardware
  1734.   present or available. }
  1735.   DDERR_NOROTATIONHW                      = $88760122 ; { MAKE_DDHRESULT( 290 ) }
  1736.  
  1737. { Operation could not be carried out because there is no hardware support
  1738.   for stretching }
  1739.   DDERR_NOSTRETCHHW                       = $88760136 ; { MAKE_DDHRESULT( 310 ) }
  1740.  
  1741. { DirectDrawSurface is not in 4 bit color palette and the requested operation
  1742.   requires 4 bit color palette. }
  1743.   DDERR_NOT4BITCOLOR                      = $8876013C ; { MAKE_DDHRESULT( 316 ) }
  1744.  
  1745. { DirectDrawSurface is not in 4 bit color index palette and the requested
  1746.   operation requires 4 bit color index palette. }
  1747.   DDERR_NOT4BITCOLORINDEX                 = $8876013D ; { MAKE_DDHRESULT( 317 ) }
  1748.  
  1749. { DirectDraw Surface is not in 8 bit color mode and the requested operation
  1750.   requires 8 bit color. }
  1751.   DDERR_NOT8BITCOLOR                      = $88760140 ; { MAKE_DDHRESULT( 320 ) }
  1752.  
  1753. { Operation could not be carried out because there is no texture mapping
  1754.   hardware present or available. }
  1755.   DDERR_NOTEXTUREHW                       = $8876014A ; { MAKE_DDHRESULT( 330 ) }
  1756.  
  1757. { Operation could not be carried out because there is no hardware support
  1758.   for vertical blank synchronized operations. }
  1759.   DDERR_NOVSYNCHW                         = $8876014F ; { MAKE_DDHRESULT( 335 ) }
  1760.  
  1761. { Operation could not be carried out because there is no hardware support
  1762.   for zbuffer blting. }
  1763.   DDERR_NOZBUFFERHW                       = $88760154 ; { MAKE_DDHRESULT( 340 ) }
  1764.  
  1765. { Overlay surfaces could not be z layered based on their BltOrder because
  1766.   the hardware does not support z layering of overlays. }
  1767.   DDERR_NOZOVERLAYHW                      = $8876015E ; { MAKE_DDHRESULT( 350 ) }
  1768.  
  1769. { The hardware needed for the requested operation has already been
  1770.   allocated. }
  1771.   DDERR_OUTOFCAPS                         = $88760168 ; { MAKE_DDHRESULT( 360 ) }
  1772.  
  1773. { DirectDraw does not have enough memory to perform the operation. }
  1774.   DDERR_OUTOFMEMORY                       = E_OUTOFMEMORY ;
  1775.  
  1776. { DirectDraw does not have enough memory to perform the operation. }
  1777.   DDERR_OUTOFVIDEOMEMORY                  = $8876017C ; { MAKE_DDHRESULT( 380 ) }
  1778.  
  1779. { hardware does not support clipped overlays }
  1780.   DDERR_OVERLAYCANTCLIP                   = $8876017E ; { MAKE_DDHRESULT( 382 ) }
  1781.  
  1782. { Can only have ony color key active at one time for overlays }
  1783.   DDERR_OVERLAYCOLORKEYONLYONEACTIVE      = $88760180 ; { MAKE_DDHRESULT( 384 ) }
  1784.  
  1785. { Access to this palette is being refused because the palette is already
  1786.   locked by another thread. }
  1787.   DDERR_PALETTEBUSY                       = $88760183 ; { MAKE_DDHRESULT( 387 ) }
  1788.  
  1789. { No src color key specified for this operation. }
  1790.   DDERR_COLORKEYNOTSET                    = $88760190 ; { MAKE_DDHRESULT( 400 ) }
  1791.  
  1792. { This surface is already attached to the surface it is being attached to. }
  1793.   DDERR_SURFACEALREADYATTACHED            = $8876019A ; { MAKE_DDHRESULT( 410 ) }
  1794.  
  1795. { This surface is already a dependency of the surface it is being made a
  1796.   dependency of. }
  1797.   DDERR_SURFACEALREADYDEPENDENT           = $887601A4 ; { MAKE_DDHRESULT( 420 ) }
  1798.  
  1799. { Access to this surface is being refused because the surface is already
  1800.   locked by another thread. }
  1801.   DDERR_SURFACEBUSY                       = $887601AE ; { MAKE_DDHRESULT( 430 ) }
  1802.  
  1803. { Access to Surface refused because Surface is obscured. }
  1804.   DDERR_SURFACEISOBSCURED                 = $887601B2 ; { MAKE_DDHRESULT( 440 ) }
  1805.  
  1806. { Access to this surface is being refused because the surface is gone.
  1807.   The DIRECTDRAWSURFACE object representing this surface should
  1808.   have Restore called on it. }
  1809.   DDERR_SURFACELOST                       = $887601BC ; { MAKE_DDHRESULT( 450 ) }
  1810.  
  1811. { The requested surface is not attached. }
  1812.   DDERR_SURFACENOTATTACHED                = $887601C6 ; { MAKE_DDHRESULT( 460 ) }
  1813.  
  1814. { Height requested by DirectDraw is too large. }
  1815.   DDERR_TOOBIGHEIGHT                      = $887601D0 ; { MAKE_DDHRESULT( 470 ) }
  1816.  
  1817. { Size requested by DirectDraw is too large --  The individual height and
  1818.   width are OK. }
  1819.   DDERR_TOOBIGSIZE                        = $887601DA ; { MAKE_DDHRESULT( 480 ) }
  1820.  
  1821. { Width requested by DirectDraw is too large. }
  1822.   DDERR_TOOBIGWIDTH                       = $887601E4 ; { MAKE_DDHRESULT( 490 ) }
  1823.  
  1824. { Action not supported. }
  1825.   DDERR_UNSUPPORTED                       = E_NOTIMPL ;
  1826.  
  1827. { FOURCC format requested is unsupported by DirectDraw }
  1828.   DDERR_UNSUPPORTEDFORMAT                 = $887601FE ; { MAKE_DDHRESULT( 510 ) }
  1829.  
  1830. { Bitmask in the pixel format requested is unsupported by DirectDraw }
  1831.   DDERR_UNSUPPORTEDMASK                   = $88760208 ; { MAKE_DDHRESULT( 520 ) }
  1832.  
  1833. { vertical blank is in progress }
  1834.   DDERR_VERTICALBLANKINPROGRESS           = $88760219 ; { MAKE_DDHRESULT( 537 ) }
  1835.  
  1836. { Informs DirectDraw that the previous Blt which is transfering information
  1837.   to or from this Surface is incomplete. }
  1838.   DDERR_WASSTILLDRAWING                   = $8876021C ; { MAKE_DDHRESULT( 540 ) }
  1839.  
  1840. { Rectangle provided was not horizontally aligned on reqd. boundary }
  1841.   DDERR_XALIGN                            = $88760230 ; { MAKE_DDHRESULT( 560 ) }
  1842.  
  1843. { The GUID passed to DirectDrawCreate is not a valid DirectDraw driver
  1844.   identifier. }
  1845.   DDERR_INVALIDDIRECTDRAWGUID             = $88760231 ; { MAKE_DDHRESULT( 561 ) }
  1846.  
  1847. { A DirectDraw object representing this driver has already been created
  1848.   for this process. }
  1849.   DDERR_DIRECTDRAWALREADYCREATED          = $88760232 ; { MAKE_DDHRESULT( 562 ) }
  1850.  
  1851. { A hardware only DirectDraw object creation was attempted but the driver
  1852.   did not support any hardware. }
  1853.   DDERR_NODIRECTDRAWHW                    = $88760233 ; { MAKE_DDHRESULT( 563 ) }
  1854.  
  1855. { this process already has created a primary surface }
  1856.   DDERR_PRIMARYSURFACEALREADYEXISTS       = $88760234 ; { MAKE_DDHRESULT( 564 ) }
  1857.  
  1858. { software emulation not available. }
  1859.   DDERR_NOEMULATION                       = $88760235 ; { MAKE_DDHRESULT( 565 ) }
  1860.  
  1861. { region passed to Clipper::GetClipList is too small. }
  1862.   DDERR_REGIONTOOSMALL                    = $8876236 ; { MAKE_DDHRESULT( 566 ) }
  1863.  
  1864. { an attempt was made to set a clip list for a clipper objec that
  1865.   is already monitoring an hwnd. }
  1866.   DDERR_CLIPPERISUSINGHWND                = $88760237 ; { MAKE_DDHRESULT( 567 ) }
  1867.  
  1868. { No clipper object attached to surface object }
  1869.   DDERR_NOCLIPPERATTACHED                 = $88760238 ; { MAKE_DDHRESULT( 568 ) }
  1870.  
  1871. { Clipper notification requires an HWND or
  1872.   no HWND has previously been set as the CooperativeLevel HWND. }
  1873.   DDERR_NOHWND                            = $88760239 ; { MAKE_DDHRESULT( 569 ) }
  1874.  
  1875. { HWND used by DirectDraw CooperativeLevel has been subclassed,
  1876.   this prevents DirectDraw from restoring state. }
  1877.   DDERR_HWNDSUBCLASSED                    = $8876023A ; { MAKE_DDHRESULT( 570 ) }
  1878.  
  1879. { The CooperativeLevel HWND has already been set.
  1880.   It can not be reset while the process has surfaces or palettes created. }
  1881.   DDERR_HWNDALREADYSET                    = $8876023B ; { MAKE_DDHRESULT( 571 ) }
  1882.  
  1883. { No palette object attached to this surface. }
  1884.   DDERR_NOPALETTEATTACHED                 = $8876023C ; { MAKE_DDHRESULT( 572 ) }
  1885.  
  1886. { No hardware support for 16 or 256 color palettes. }
  1887.   DDERR_NOPALETTEHW                       = $8876023D ; { MAKE_DDHRESULT( 573 ) }
  1888.  
  1889. { If a clipper object is attached to the source surface passed into a
  1890.   BltFast call. }
  1891.   DDERR_BLTFASTCANTCLIP                   = $8876023E ; { MAKE_DDHRESULT( 574 ) }
  1892.  
  1893. { No blter. }
  1894.   DDERR_NOBLTHW                           = $8876023F ; { MAKE_DDHRESULT( 575 ) }
  1895.  
  1896. { No DirectDraw ROP hardware. }
  1897.   DDERR_NODDROPSHW                        = $88760240 ; { MAKE_DDHRESULT( 576 ) }
  1898.  
  1899. { returned when GetOverlayPosition is called on a hidden overlay }
  1900.   DDERR_OVERLAYNOTVISIBLE                 = $88760241 ; { MAKE_DDHRESULT( 577 ) }
  1901.  
  1902. { returned when GetOverlayPosition is called on a overlay that UpdateOverlay
  1903.   has never been called on to establish a destionation. }
  1904.   DDERR_NOOVERLAYDEST                     = $88760242 ; { MAKE_DDHRESULT( 578 ) }
  1905.  
  1906. { returned when the position of the overlay on the destionation is no longer
  1907.   legal for that destionation. }
  1908.   DDERR_INVALIDPOSITION                   = $88760243 ; { MAKE_DDHRESULT( 579 ) }
  1909.  
  1910. { returned when an overlay member is called for a non-overlay surface }
  1911.   DDERR_NOTAOVERLAYSURFACE                = $88760244 ; { MAKE_DDHRESULT( 580 ) }
  1912.  
  1913. { An attempt was made to set the cooperative level when it was already
  1914.   set to exclusive. }
  1915.   DDERR_EXCLUSIVEMODEALREADYSET           = $88760245 ; { MAKE_DDHRESULT( 581 ) }
  1916.  
  1917. { An attempt has been made to flip a surface that is not flippable. }
  1918.   DDERR_NOTFLIPPABLE                      = $88760246 ; { MAKE_DDHRESULT( 582 ) }
  1919.  
  1920. { Can't duplicate primary & 3D surfaces, or surfaces that are implicitly
  1921.   created. }
  1922.   DDERR_CANTDUPLICATE                     = $88760247 ; { MAKE_DDHRESULT( 583 ) }
  1923.  
  1924. { Surface was not locked.  An attempt to unlock a surface that was not
  1925.   locked at all, or by this process, has been attempted. }
  1926.   DDERR_NOTLOCKED                         = $88760248 ; { MAKE_DDHRESULT( 584 ) }
  1927.  
  1928. { Windows can not create any more DCs }
  1929.   DDERR_CANTCREATEDC                      = $88760249 ; { MAKE_DDHRESULT( 585 ) }
  1930.  
  1931. { No DC was ever created for this surface. }
  1932.   DDERR_NODC                              = $8876024A ; { MAKE_DDHRESULT( 586 ) }
  1933.  
  1934. { This surface can not be restored because it was created in a different
  1935.   mode. }
  1936.   DDERR_WRONGMODE                         = $8876924B ; { MAKE_DDHRESULT( 587 ) }
  1937.  
  1938. { This surface can not be restored because it is an implicitly created
  1939.   surface. }
  1940.   DDERR_IMPLICITLYCREATED                 = $8876024C ; { MAKE_DDHRESULT( 588 ) }
  1941.  
  1942. { The surface being used is not a palette-based surface }
  1943.   DDERR_NOTPALETTIZED                     = $8876024D ; { MAKE_DDHRESULT( 589 ) }
  1944.  
  1945. { The display is currently in an unsupported mode }
  1946.   DDERR_UNSUPPORTEDMODE                   = $8876024E ; { MAKE_DDHRESULT( 590 ) }
  1947.  
  1948. {*
  1949.  * 1 bit alpha constants
  1950.  *}
  1951.  
  1952. { Completely transparent. Colors being blended with this constant do not effect
  1953.   the final result. }
  1954.   DDALPHA1_TRANSPARENT                    = 0 ;
  1955.  
  1956. { Completely opaque. Colors being blended with this constant are the final result. }
  1957.   DDALPHA1_OPAQUE                         = 1 ;
  1958.  
  1959. {*
  1960.  * 2 bit alpha constants
  1961.  *}
  1962.  
  1963. { Completely transparent. Colors being blended with this constant do not effect
  1964.   the final result. }
  1965.   DDALPHA2_TRANSPARENT                    = 0 ;
  1966.  
  1967. { 50-50 blend.  Colors being blended with this constant effect the final result
  1968.   with 50% of their color. }
  1969.   DDALPHA2_50                             = 2 ;
  1970.  
  1971. { Completely opaque. Colors being blended with this constant are the final result. }
  1972.   DDALPHA2_OPAQUE                         = 3 ;
  1973.  
  1974. {*
  1975.  * 4 bit alpha constants
  1976.  *}
  1977.  
  1978. { Completely transparent. Colors being blended with this constant do not effect
  1979.   the final result. }
  1980.   DDALPHA4_TRANSPARENT                    = 0 ;
  1981.  
  1982. { Opaque modifier is multiplied by any value between 0 and _OPAQUE to
  1983.   establish gradients of alpha blending. }
  1984.   DDALPHA4_OPAQUEMOD                      = 1 ;
  1985.  
  1986. { 50-50 blend.  Colors being blended with this constant effect the final result
  1987.   with 50% of their color. }
  1988.   DDALPHA4_50                             = 8 ;
  1989.  
  1990. { Completely opaque. Colors being blended with this constant are the final result. }
  1991.   DDALPHA4_OPAQUE                         = 15 ;
  1992.  
  1993. {*
  1994.  * 8 bit alpha constants
  1995.  *}
  1996.  
  1997. { Completely transparent. Colors being blended with this constant do not effect
  1998.   the final result. }
  1999.   DDALPHA8_TRANSPARENT                    = 0 ;
  2000.  
  2001. { Opaque modifier is multiplied by any value between 0 and _OPAQUE to
  2002.   establish gradients of alpha blending. }
  2003.   DDALPHA8_OPAQUEMOD                      = 1 ;
  2004.  
  2005. { 50-50 blend.  Colors being blended with this constant effect the final result
  2006.   with 50% of their color. }
  2007.   DDALPHA8_50                             = 128 ;
  2008.  
  2009. { Completely opaque. Colors being blended with this constant are the final result. }
  2010.   DDALPHA8_OPAQUE                         = 255 ;
  2011.  
  2012. { API's }
  2013.  
  2014. function DirectDrawCreate ( lpGUID: PGUID; var lplpDD: IDirectDraw; pUnkOuter: IUnknown ): HRESULT ; stdcall ;
  2015.  
  2016. implementation
  2017.  
  2018. function DirectDrawCreate ; external 'DDRAW' ;
  2019.  
  2020. end.
  2021.